AIUTO CODICE STRATEGIA ZIG ZAG

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #20107 quote
    ALE
    Moderator
    Master

    Ciao
    sto cercando di far funzionare una strategia su questo indicatore: PRC_FractalsZigZag, ma non capisco perché gli ordini vengono eseguiti in nel modo scorretto.
    Allego entrambi i file:
    Bozza strategia : TRADING_ON_PRC_FractalsZigZag
    Indicatore : PRC_FractalsZigZag
    Grazie
    Ale

    TRADING_ON_PRC_FractalsZigZag.itf PRC_FractalsZigZag.itf
    #20112 quote
    Nicolas
    Keymaster
    Master

    Qual è esattamente il problema?
    Si prega di tenere presente che i frattali sono disegnati in seguito e, in passato, non ho letto il tuo codice, ma sarebbe un indizio per il vostro problema ..

    #20119 quote
    ALE
    Moderator
    Master

    Ciao Nicolas
    problema risolto..

     

    Grazie

    Ale

    #55604 quote
    Gianluca
    Participant
    Master
    Ciao Nicolas problema risolto.. Grazie Ale


    come?

     

    #55615 quote
    Gianluca
    Participant
    Master

    Ciao, ho ottimizzato un pò per il Dax Cash 30m di IG magari può interessare.

    FractalsZigZagOptDax30m.itf
    #55618 quote
    ALE
    Moderator
    Master

    Ciao

    grazie altares, lo guardo volentieri, ti faccio sapere

    grazie 

     

    #55619 quote
    ALE
    Moderator
    Master

    Ciao

    grazie altares, lo guardo volentieri, ti faccio sapere

    grazie 

     

    #55690 quote
    Gianluca
    Participant
    Master
    Ciao grazie altares, lo guardo volentieri, ti faccio sapere grazie


    Allora che ne pensi?

    #55694 quote
    ALE
    Moderator
    Master

    Non e male, pero cosi non si potrebbe usare, bisogna migliorarlo, appena ho un po di tempo ti darei una mano
    Grazie

    Ale

    #55696 quote
    Gianluca
    Participant
    Master

    Si è una bozza perchè sto lavorando su altri che ho ideato io, ma perchè dici che non si potrebbe usarE?

    #66076 quote
    beppe8949
    Participant
    Average
    Non e male, pero cosi non si potrebbe usare, bisogna migliorarlo, appena ho un po di tempo ti darei una manoGrazie Ale
    Ciao Ale, anche io sto cercando da ieri di fare un trading system per la strategia Zigzag ma senza molti risultati.. Tu riusciresti a darmi una mano? Ti ringrazio!
    #87061 quote
    alexcold
    Participant
    Junior
    ci siete riusciti? anche a me interessa un trading system sul DAX
    #87193 quote
    Gianluca
    Participant
    Master
    ci siete riusciti? anche a me interessa un trading system sul DAX
    ce ne sono miliardi sul forum, cmq ho modificato quello dell’epoca per renderlo più sensato, ma provalo in demo e poi andrebbero fatte altre modifiche
    //Dax 30min Cfd 1€
    defparam cumulateorders = false
    timeon= time > 0 and time < 160000
    CP=61
    //cp = 20
    if high[cp] >= highest[2*cp+1](high) then
    LH = 1
    else
    LH = 0
    endif
    if low[cp] <= lowest[2*cp+1](low)  then
    LL = -1
    else
    LL = 0
    endif
    if LH = 1 then
    TOPy = high[cp]
    //TOPx = barindex[cp]
    endif
    if LL = -1 then
    BOTy = low[cp]
    //BOTx = barindex[cp]
    endif
    a=LH>0
    B=LL<0
    // Condizioni per entrare su posizioni long
    mom=momentum[7]
    long= (a and timeon) and (mom<75)
    short= b and timeon and (mom>-65)
    IF NOT LongOnMarket AND long  THEN
    BUY 1 CONTRACTS AT topy-80*pipsize limit//MARKET
    ENDIF
    // Condizioni per entrare su posizioni short
    IF NOT ShortOnMarket AND short THEN
    SELLSHORT 1 CONTRACTS AT boty+65/pipsize limit// MARKET
    ENDIF
    
    set stop ploss 80
    set target profit 70
    
    if time > 220000 then
    sell at market
    exitshort at market
    endif
    
    
    //************************************************************************
    //trailing stop function
    trailingstart = 40 //trailing will start @trailinstart points profit
    trailingstep = 5 //trailing step to move the "stoploss"
    
    //reset the stoploss value
    IF NOT ONMARKET THEN
    newSL=0
    ENDIF
    
    //manage long positions
    IF LONGONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THEN
    newSL = tradeprice(1)+trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND close-newSL>=trailingstep*pipsize THEN
    newSL = newSL+trailingstep*pipsize
    ENDIF
    ENDIF
    
    //manage short positions
    IF SHORTONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THEN
    newSL = tradeprice(1)-trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND newSL-close>=trailingstep*pipsize THEN
    newSL = newSL-trailingstep*pipsize
    ENDIF
    ENDIF
    
    //stop order to exit the positions
    IF newSL>0 THEN
    SELL AT newSL STOP
    EXITSHORT AT newSL STOP
    ENDIF
    //************************************************************************
    
    Nicolas thanked this post
Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.

AIUTO CODICE STRATEGIA ZIG ZAG


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
ALE @aleale Moderator
Summary

This topic contains 12 replies,
has 5 voices, and was last updated by Gianluca
7 years, 3 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 01/07/2017
Status: Active
Attachments: 3 files
Logo Logo
Loading...