TS Stocastic BreakOut

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #12132 quote
    Conte Caimano
    Participant
    Master

    buongiorno a tutti,

    volevo condividere con voi il trading system “Stocastic BreakOut”, che utilizzo con IG, e richiedere un aiuto per capire cosa non funziona correttamente.

    Stocastic BreakOut è un TS da ottimizzare e funziona su ogni timeframe, su valute ed indici (l’immagine allegata è il risultato dell’ottimizzazione del DAX giornaliero con data inizio 01/06/2015 e data fine 06/06/2016).

    Ho notato che a volte l’istruzione “Crosse Over” e “Crosses Under” non vengono eseguite correttamente.

    Per verificare l’operatività del TS ho creato un indicatore ad onda quadra (va a 1 quando il TS è long e va a -1 quando il TS è short), così ho notato che mentre il ProOrder crea il giusto segnale di short l’indicatore a onda quadra non fornisce lo stesso segnale (vedi immagine allegata).

     

    //TS stochastic breakout
    // ---------------------------------------------------------------------
    // -------------------------- VARIABILI
    //Ottimizzare v1, v2, v3 da 3 a 31 a passi di 2
    // ---------------------------------------------------------------------
    DEFPARAM CumulateOrders = False
    DEFPARAM NoCashUpdate = True
    
    Pr=TypicalPrice
    
    ST=100*(Pr-lowest[v1](Pr))/(highest[v1](Pr)-lowest[v1](Pr))
    MA=highest[v3](ST)
    ML=lowest[v3](ST)
    
    MAp=MA[v2]
    MLp=ML[v2]
    
    Long=(ST crosses under MAp)
    Short=(ST crosses over MLp)
    
    // --- calcola Lotti
    Lotti = 1
    // ---------------------------------------------------------------------
    // Condizioni per entrare su posizioni long
    IF NOT LongOnMarket AND Long THEN
    BUY Lotti CONTRACTS AT MARKET NEXTBAROPEN
    ENDIF
    
    // Condizioni per entrare su posizioni short
    IF NOT ShortOnMarket AND Short  THEN
    SELLSHORT Lotti CONTRACTS AT MARKET NEXTBAROPEN
    ENDIF
    // Stop e target:
    // ---------------------------------------------------------------------
    // I Caimani della Finanza - master@infofinanfa.com
    // ---------------------------------------------------------------------

     

    // ———————————————————————
    // Indicatore a onda quadra Stochastic BreakOut
    // ———————————————————————
    // ————————– VARIABILI
    //Ottimizzare v1, v2, v3 da 3 a 31 a passi di 2
    // ———————————————————————
    Pr=TypicalPrice

    ST=100*(Pr-lowest[v1](Pr))/(highest[v1](Pr)-lowest[v1](Pr))
    MA=highest[v3](ST)
    ML=lowest[v3](ST)

    MAp=MA[v2]
    MLp=ML[v2]
    // ———————————————————————
    Long=(ST crosses under MAp)
    Short=(ST crosses over MLp)
    // ———————————————————————

    IF Long THEN
    IndexStochasticBreakOut = 1
    ENDIF

    IF Short THEN
    IndexStochasticBreakOut = -1
    ENDIF

    Return IndexStochasticBreakOut as “Stocastico BrteakOut”
    // ———————————————————————
    // I Caimani della Finanza – master@infofinanfa.com
    // ———————————————————————

    #12207 quote
    Nicolas
    Keymaster
    Master

    Ciao,
    Sei sicuro che si sta utilizzando gli stessi parametri variabili tra la strategia e l’indicatore che hai costruito?

    #12216 quote
    Conte Caimano
    Participant
    Master

    Ciao Nicolas,

    si sono sicuro di utilizzare gli stessi parametri.

    ho ottimizzato il trading system con i seguenti parametri   dall’inizio: 01/06/2015 e fino a ultima data: 06/06/2016 ed ho ottenuto i seguenti risultati v1=3, v2=27 e v3=7

    ho anche inserito la riga di comando graph per facilitare la visione dell’errore  (ti riallego gli script del TS e dell’indicatore)

    Quello che mi fa nascere dei dubbi è che l’ indicatore ed il TS dovrebbero dare gli stessi risultati invece non sempre succede … (il 17/11/2015 per esempio il TS va short e l’indicatore rimane long)

    DEFPARAM NoCashUpdate = True
    //TS Stochastic Breakout
    // ---------------------------------------------------------------------
    // -------------------------- VARIABILI
    //Ottimizzare v1, v2, v3 da 3 a 31 a passi di 2
    // ---------------------------------------------------------------------
    Pr=TypicalPrice
    
    ST=100*(Pr-lowest[v1](Pr))/(highest[v1](Pr)-lowest[v1](Pr))
    MA=highest[v3](ST)
    ML=lowest[v3](ST)
    
    MAp=MA[v2]
    MLp=ML[v2]
    // ---------------------------------------------------------------------
    Long=(ST crosses under MAp)
    Short=(ST crosses over MLp)
    // ---------------------------------------------------------------------
    // --- calcola Lotti per Valute
    Lotti = 1
    // ---------------------------------------------------------------------
    // Condizioni per entrare su posizioni long
    IF NOT LongOnMarket AND Long THEN
    BUY Lotti CONTRACTS AT MARKET NEXTBAROPEN
    Position = 1
    ENDIF
    
    // Condizioni per entrare su posizioni short
    IF NOT ShortOnMarket AND Short  THEN
    SELLSHORT Lotti CONTRACTS AT MARKET NEXTBAROPEN
    Position = -1
    ENDIF
    
    Graph Position
    
    // Stop e target:
    // ---------------------------------------------------------------------
    // I Caimani della Finanza - master@infofinanfa.com
    // ---------------------------------------------------------------------
    

     

    // ---------------------------------------------------------------------
    // Indicatore a onda quadra Stochastic BreakOut
    // ---------------------------------------------------------------------
    // -------------------------- VARIABILI
    v1 = 3
    v2 = 27
    v3 = 7
    //Ottimizzare v1, v2, v3 da 3 a 31 a passi di 2
    // ---------------------------------------------------------------------
    Pr=TypicalPrice
    
    ST=100*(Pr-lowest[v1](Pr))/(highest[v1](Pr)-lowest[v1](Pr))
    MA=highest[v3](ST)
    ML=lowest[v3](ST)
    
    MAp=MA[v2]
    MLp=ML[v2]
    // ---------------------------------------------------------------------
    Long=(ST crosses under MAp)
    Short=(ST crosses over MLp)
    // ---------------------------------------------------------------------
    
    IF Long THEN
    IndexStochasticBreakOut = 1
    ENDIF
    
    IF Short THEN
    IndexStochasticBreakOut = -1
    ENDIF
    
    Return IndexStochasticBreakOut as "Stocastico BrteakOut"
    // ---------------------------------------------------------------------
    // I Caimani della Finanza - master@infofinanfa.com
    // ---------------------------------------------------------------------
    
    #12219 quote
    Nicolas
    Keymaster
    Master

    Si dovrebbe GRAPH long e GRAPH short, invece, si otterrà una migliore visione delle condizioni che scatenano i vostri commerci.

    #12220 quote
    Conte Caimano
    Participant
    Master

    si ho provato anche in questo modo, ma il problema è che mentre il ProBackTest fornisce il segnale giusto l’indicatore non cambia di valore è come se l’istruzione Crosses Over e Crosse Under funzionassero in modo diverso tra ProBackTest e ProBuilder.

    #12223 quote
    Nicolas
    Keymaster
    Master

    Hai ragione, ho appena fatto un sacco di indagini e, anche se le variabili intere sono le stesse in ProBacktest e ProBuilder, le croci sotto e sopra non restituiscono lo stesso valore.
    Sembra che ha bisogno di ulteriore assistenza da PRT …

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

TS Stocastic BreakOut


ProOrder: Trading Automatico & Backtesting

New Reply
Author
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by Nicolas
9 years, 5 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 08/23/2016
Status: Active
Attachments: No files
Logo Logo
Loading...