Système trading BREAKOUT 10MN

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #18719 quote
    larouedegann
    Participant
    Master

    Bonjour à tous,

    J’essaie de mettre en place un systême de breakout 10mn sur le même style que l’indicateur que j’ai mis en librairie.Malheureusement

    je rencontre quelques difficultés.

    Le PRINCIPE :

    En TIMEFRAME 5MN

    Entre 08h00 et 08h10,un canal est constitué du plus haut et du plus bas.

    Chaque fois que le prix casse le canal une position est prise.

    MAXIMUM 3 positions par jour

    stoploss constitué par le plus haut du canal+ 1 pip en cas de vente

    stoploss constitué par le plus bas du canal -1 pip en cas d’achat

    target profit à 8

    Voilà le principe,j’ai mis en place un code  mais cela fonctionne mal.Pour preuve en piéce jointe, j’ai un ordre d’achat en dehors du canal.il doit me manquer une astuce.

    Il me manque également les 3 positions max par jour

    DEFPARAM CUMULATEORDERS = FALSE
    DEFPARAM FLATBEFORE = 080000
    DEFPARAM FLATAFTER = 171500
    
    ONCE  NbBarLimit = 10
    
    plushaut = HIGHEST[2](high)
    plusbas = LOWEST[2](low)
    
    
    IF TIME = 081000 THEN
    MyCanal = (plushaut-plusbas)<25
    MylimitBuy = plushaut
    Mylimitsell = plusbas
    MyIndex = barindex
    ENDIF
    
    IF Barindex >= Myindex + NbBarLimit THEN
    MyLimitbuy = 0
    MyLimitsell = 0
    ENDIF
    
    // Conditions pour ouvrir une position acheteuse
    
    IF MylimitBuy AND Mycanal> 0 THEN
    BUY 1 contract AT MylimitBuy STOP
    ENDIF
    
    // Conditions pour ouvrir une position vendeuse
    IF MylimitSell AND Mycanal > 0 THEN
    SELLSHORT 1 contract AT Mylimitsell STOP
    ENDIF
    
    //STOP AND PROFIT
    
    SET target PROFIT 8

    merci d’avance si vous avez une idée

     

    #18859 quote
    Nicolas
    Keymaster
    New

    Ci-joint la version modifiée de ton code de breakout.

    Je n’ai pas vraiment testé le problème du canal, mais j’ai optimisé le code et je pense que c’est opérationnel. A ta demande, j’ai introduit le compte des trades maximums par jour autorisés.

    Si tu rencontres un problème, n’hésite pas.

    DEFPARAM CUMULATEORDERS = FALSE
    DEFPARAM FLATBEFORE = 080000
    DEFPARAM FLATAFTER = 171500
    
    if intradaybarindex=0 then
    count = 0
    lastindex = 0
    endif
    
    NbBarLimit = 10
    
    plushaut = HIGHEST[2](high)
    plusbas = LOWEST[2](low)
    
    IF TIME = 081000 THEN
    MyCanal = (plushaut-plusbas)<25*Pointsize
    MylimitBuy = plushaut
    Mylimitsell = plusbas
    MyIndex = barindex
    ENDIF
    
    IF Barindex >= Myindex + NbBarLimit THEN
    MyLimitbuy = 0
    MyLimitsell = 0
    ENDIF
    
    // Conditions pour ouvrir une position acheteuse
    if count<3 then
    IF MylimitBuy>0 AND Mycanal THEN
    BUY 1 contract AT MylimitBuy STOP
    ENDIF
    
    // Conditions pour ouvrir une position vendeuse
    IF MylimitSell>0 AND Mycanal THEN
    SELLSHORT 1 contract AT Mylimitsell STOP
    ENDIF
    endif
    
    //STOP AND PROFIT
    SET target PROFIT 8
    
    if longonmarket then
    sell at Mylimitsell-1*pointsize stop
    if tradeindex<>lastindex then
    count=count+1
    lastindex=tradeindex
    endif
    endif
    if shortonmarket then
    exitshort at Mylimitbuy+1*pointsize stop
    if tradeindex<>lastindex then
    count=count+1
    lastindex=tradeindex
    endif
    endif
     
    #19114 quote
    larouedegann
    Participant
    Master

    Merci Nicolas pour ton aide,

    Je ne t”ai pas répondu avant car j’ai des soucis de pc…..il va falloir investir.

    j”ai testé la nouvelle version,malheureusement j’ai l’impression que le compteur ne fonctionne pas car même en mettant 2 trades max,je me retrouve avec des prises de positions en dehors du canal.(voir fichier).

    A la limite, je serais tenté de faire -une position achat lors de la cassure du canal a la hausse

    -une position vente lors de la cassure du canal a la baisse

    MAX par jour.

    et d’enlever ce Nbbarlimit=10 qui apparemment me coupe la position au bout de 10 bars ????

    merci de ton aide

    #19122 quote
    Nicolas
    Keymaster
    New

    Ci-joint une petite correction, suite à tes tests:

    DEFPARAM CUMULATEORDERS = FALSE
    DEFPARAM FLATBEFORE = 080000
    DEFPARAM FLATAFTER = 171500
    
    if intradaybarindex=0 then
    count = 0
    lastindex = 0
    endif
    
    NbBarLimit = 10
    
    plushaut = HIGHEST[2](high)
    plusbas = LOWEST[2](low)
    
    IF TIME = 081000 THEN
    MyCanal = (plushaut-plusbas)<25*Pointsize
    MylimitBuy = plushaut
    Mylimitsell = plusbas
    MyIndex = barindex
    ENDIF
    
    IF Barindex >= Myindex + NbBarLimit THEN
    MyCanal = 0
    ENDIF
    
    // Conditions pour ouvrir une position acheteuse
    if count<3 and Barindex <= Myindex + NbBarLimit then
    IF Mycanal THEN
    BUY 1 contract AT MylimitBuy STOP
    ENDIF
    
    // Conditions pour ouvrir une position vendeuse
    IF Mycanal THEN
    SELLSHORT 1 contract AT Mylimitsell STOP
    ENDIF
    endif
    
    //STOP AND PROFIT
    SET target pPROFIT 8
    
    if longonmarket then
    sell at Mylimitsell-1*pointsize stop
    if tradeindex<>lastindex then
    count=count+1
    lastindex=tradeindex
    endif
    endif
    if shortonmarket then
    exitshort at Mylimitbuy+1*pointsize stop
    if tradeindex<>lastindex then
    count=count+1
    lastindex=tradeindex
    endif
    endif
    

    C’est mieux désormais ?

    #19138 quote
    larouedegann
    Participant
    Master

    salut Nicolas,

    je viens juste de recevoir Mon bestiau de pc. le temps de tout remettre en route et je vais retester.

    je reviens vers toi lorsque tout est ok

    a +

    #19296 quote
    larouedegann
    Participant
    Master

    Salut Nicolas,

    J’ai abandonné cette stratégie, car en testant le breakout de 8h10 on s’aperçoit qu’elle est négative en long terme (2 ans).Donc ce n’est pas la bonne.

    Je vais essayer de la travailler en Heinki Ashi.

    merci à toi pour le nombre de position.

    #20284 quote
    larouedegann
    Participant
    Master

    Salut nicolas,

    Je reviens à la charge avec mon breakout 10mn 8h00-8h10 en heinki-ashi qui fonctionne pas trop mal.

    DEFPARAM CUMULATEORDERS = false
    DEFPARAM FLATBEFORE = 080000
    DEFPARAM FLATAFTER = 171500
    
    Position = 2
    
    //HEINKIN-ASHI
    
    Xclose = (open+close+high+low)/4
    Xopen = (xopen[1]+xclose[1])/2
    //Xhigh = high
    //Xlow = low
    
    IF Time = 081000 THEN
    haut = highest[2](high)
    bas = lowest[2](low)
    amplitude = haut - bas
    Mybuy = 0
    Mysell = 0
    ENDIF
    
    IF TIME > 081000 AND TIME <= 170000 THEN
    //Conditions pour ouvrir une position acheteuse
    IF Mybuy = 0 AND (amplitude<25*pipsize) AND( Xclose>haut) THEN
    BUY Position contracts at haut stop
    ENDIF
    If longonmarket THEN
    Mybuy = 1
    ENDIF
    
    //Conditions pour ouvrir une position vendeuse
    IF Mysell = 0 AND (amplitude<25*pipsize) AND (Xclose<bas) THEN
    SELLSHORT Position contracts at bas stop
    ENDIF
    IF shortonmarket THEN
    Mysell = 1
    ENDIF
    
    
    //stops et Objectifs
    SET STOP LOSS 30
    SET TARGET PPROFIT 23
    ENDIF

    Je l’ai mis en réel la semaine dernière et il a pas trop mal fonctionné.le backtest correspondait à la réalité.Sauf aujourd’hui à ma grande surprise,il reprenait une position à chaque trade gagnant.Je pensait qu”en mettant 0 et 1, il s’arreterait de lui-même  !!!!

    Financièrement, c”est pas un problême puisqu’il prenait une position a chaque trage gagnant.Et je pensait qu’il allait s’arreter de lui-même avec le stop loss.mais non (cf fichier).

    même avec un trade perdant il a repris une position.

    Ce qui me surprends c’est que je l’ai backtester en tick by tick.et qu’il ne reprend pas de position….bizarre

    Le systême est pas mal quand même sauf que je pensais qu’il coupait à la première perte.(c’est ce qui c’est passer dans la majorité des cas).

    Je l’ai mis en librairiepas passer) mais apparemment il y a un bug. ou une amélioration.

    Aurait tu une idée ?

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

Système trading BREAKOUT 10MN


Support ProOrder

New Reply
Author
Summary

This topic contains 6 replies,
has 2 voices, and was last updated by larouedegann
9 years ago.

Topic Details
Forum: Support ProOrder
Language: French
Started: 12/17/2016
Status: Active
Attachments: No files
Logo Logo
Loading...