pattern 80/20

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #10825 quote
    Marianor76
    Participant
    New

    Salve,

    vorrei testare una strategia sul pattern 80/20, visto che ho trovato in rete la formula per identificarlo.

    di seguito post il mio listato, magari qulcuno può aiutarmi a farlo funzionare.

    dovrei entrare la candela dopo il pattern, al livello del minimo dello stesso, se  la candela dopo l’80/20, apre in gap down, sotto il minimo precedente.

    ecco il listato, saluto e ringrazio per l’aiuto.

    DEFPARAM CumulateOrders=False
    // proback test 80 20
    o0=open[0]
    o=open[1]
    c=close[1]
    hi=high[1]
    lo=low[1]
    
    // identificazione pattern 80/20
    if o >((hi-lo)*0.8 + lo)and c <((hi-lo)* 0.2 + lo) and o0 < lo then
    
    buy 800 cash AT lo*ticksize STOP
    SET TARGET %PROFIT 6
    
    SET STOP %LOSS 3
    endif
    #122834 quote
    giustim
    Participant
    Junior

    Ciao.

    Sei riuscito a farlo funzionare?

    #122837 quote
    robertogozzi
    Moderator
    Master

    > Per chiarezza dei messaggi sul Forum di Prorealcode, separate le parti del vostro codice usando il pulsante per l’inserimento del testo del codice. << Grazie 🙂

    Questo può essere il codice corretto (aggiustato per il Forex):

    DEFPARAM CumulateOrders=False
    // identificazione pattern 80/20
    Pattern8020 = (Open >= ((range * 0.8) + low)) AND (Close <= ((range * 0.2) + low))
    if Pattern8020 then
       buy 1 CONTRACT AT low LIMIT
       SET TARGET %PROFIT 6
       SET STOP   %LOSS   3
    endif
    #122838 quote
    Nicolas
    Keymaster
    Master

    Penso che la strategia dovrebbe essere codificata in questo modo:

    DEFPARAM CumulateOrders=False
    // proback test 80 20
    o0=open[0]
    o=open[1]
    c=close[1]
    hi=high[1]
    lo=low[1]
    
    // identificazione pattern 80/20
    if o >((hi-lo)*0.8 + lo)and c <((hi-lo)* 0.2 + lo) and o0 < lo then
    
    buy 800 cash AT lo STOP
    SET TARGET %PROFIT 6
    
    SET STOP %LOSS 3
    endif
    #122843 quote
    robertogozzi
    Moderator
    Master

    La strategia corretta e completa è:

    // Pattern d'inversione 80/20
    //
    // http://bussolaforex.altervista.org/14647-2/
    // http://www.traderpedia.it/wiki/index.php/80-20
    //
    DEFPARAM CumulateOrders=False
    //
    // identificazione del pattern 80/20
    //
    // Long
    Long8020a = (Open[1] >= ((range[1] * 0.8) + low[1])) AND (Close[1] <= ((range[1] * 0.2) + low[1]))
    Long8020b = Open < (low[1] - 10 * pipsize)    //5-15 pips sotto il minimo  precedente
    Long8020  = Long8020a AND Long8020b
    if Long8020 AND Not OnMarket then
       buy 1 CONTRACT AT low[1] STOP
    endif
    //
    // LShort
    Short8020a = (Open[1] <= ((range[1] * 0.2) + low[1])) AND (Close[1] >= ((range[1] * 0.8) + low[1]))
    Short8020b = Open > (high[1] + 10 * pipsize)    //5-15 pips sopra il massimo precedente
    Short8020  = Short8020a AND Short8020b
    if Short8020 AND Not OnMarket then
       SELLSHORT 1 CONTRACT AT high[1] STOP
    endif
    //
    SET TARGET %PROFIT 6
    SET STOP   %LOSS   3
    #122860 quote
    giustim
    Participant
    Junior

    A me non ritorna nessun risultato quest’ultima sul Daily

    #122863 quote
    robertogozzi
    Moderator
    Master

    A me sul Daily DAX fa 11 operazioni da Agosto 2010 ad oggi.

    In effetti sono poche, evidentemente è un pattern raro da trovare.

    #122870 quote
    giustim
    Participant
    Junior

    Però l’80/20 sarebbe intraday, o sbaglio?

    Sul Dax invece così dura molto

    #122881 quote
    robertogozzi
    Moderator
    Master

    I pochi segnali sono dovuti al fatto che IG tratta i CFD ed hanno pochi gap, per cui è difficile che quel pattern venga trovato. Ho provato sulla versione 11 della PRT (opera sui Futures) ed è tutta un’altra cosa. Quando, e se, IB supporterà il trading automatico allora cambieranno le cose!

    Dalle immagini allegate, una per la v10.3 ed una per la v11 vedrai le differenze nel numero di segnali, dati dal seguente indicatore (sul Daily, perché dovrebbe essere un pattern solo intraday?):

    // Pattern d'inversione 80/20
    //
    // http://bussolaforex.altervista.org/14647-2/
    // http://www.traderpedia.it/wiki/index.php/80-20
    //
    ONCE Gap  = 10 * pipsize                      //10
    ONCE p08  = 0.80                              //0.80
    ONCE p02  = 0.20                              //0.20
    //
    // Long
    Long8020a = (Open[1] >= ((range[1] * p08) + low[1])) AND (Close[1] <= ((range[1] * p02) + low[1]))
    Long8020b = Open < (low[1] - Gap)
    Long8020  = Long8020a AND Long8020b
    //
    // LShort
    Short8020a = (Open[1] <= ((range[1] * p02) + low[1])) AND (Close[1] >= ((range[1] * p08) + low[1]))
    Short8020b = Open > (high[1] + Gap)
    Short8020  = Short8020a AND Short8020b
    //
    Signal = 0
    if Long8020 then
       Signal = 1
    endif
    if Short8020 then
       Signal = -1
    endif
    RETURN Signal AS "Signal",0 AS "0"
    Pattern8020-v103.jpg Pattern8020-v103.jpg Pattern8020-v11.jpg Pattern8020-v11.jpg
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.

pattern 80/20


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Marianor76 @marianor76 Participant
Summary

This topic contains 8 replies,
has 4 voices, and was last updated by robertogozzi
5 years, 10 months ago.

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