Posizione di entrata ed uscita con SuperTrend

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #133691 quote
    Stefano FazionStefano Fazion
    Participant
    Junior

    Ciao!

    Relativamente ad una semplice strategia con il SuperTrend(10,3), secondo me mi fà entra sempre in long ed in short non all’apertura della barra successiva come indicato nella strategia semplificata, ma due barre dopo.

    Come mai?

    // Definizione dei parametri del codice
    DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate
    
    // Condizioni per entrare su posizioni long
    indicator1 = SuperTrend[3,10]
    c1 = (indicator1 < close)
    
    IF c1 THEN
    BUY 5 CONTRACT AT MARKET
    ENDIF
    
    // Condizioni per uscire da posizioni long
    indicator2 = SuperTrend[3,10]
    c2 = (indicator2[1] >= close[1])
    
    IF c2 THEN
    SELL AT MARKET
    ENDIF
    Annotazione-2020-05-29-033605.jpg Annotazione-2020-05-29-033605.jpg Annotazione-2020-05-29-033824.jpg Annotazione-2020-05-29-033824.jpg
    #133749 quote
    NicolasNicolas
    Keymaster
    Legend

    Sei sicuro che SuperTrend sul tuo grafico abbia le stesse impostazioni esatte di quelle definite nel tuo codice?

    #133829 quote
    Stefano FazionStefano Fazion
    Participant
    Junior

    Certo, l’ho fatto con la creazione semplificata cliccando direttamente sul grafico.

    Comunque ho capito il perchè. Sempre con la creazione semplificata, se scelgo “chiusura barra” fa così come si vede, se scelgo “barra in corso” me lo fa corretto.

    La strategia sotto è quella del post precedente, quella sopra è quella con “barra in corso”.

    Annotazione-2020-05-29-230151.png Annotazione-2020-05-29-230151.png
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Posizione di entrata ed uscita con SuperTrend


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Stefano Fazion @faxuno Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Stefano FazionStefano Fazion
6 years, 4 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 05/29/2020
Status: Active
Attachments: 3 files
ProRealCode ProRealCode
Loading...