Problèmes pro-order VS backtest

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #25059 quote
    Victorio
    Participant
    Senior

    Bonjour.

    J’ai décidément bien des soucis avec pro-order. J’ai un excellent backtest sur de l’ut2mn F40 (de l’ordre de 94% de taux de réussite sur 15j / 55 positions). Je l’ai donc mis en route sur pro-order dimanche. Hier tout était “normal”, c’est à dire que les signaux backtest et pro-order étaient 100% conformes.

    Ce matin à l’ouverture de la plateforme, je constate que

    -Des signaux du backtest d’hier ont disparu.Je pensais que ce problème ne se rencontrait qu’en ticks. D’autre part il a pris une position à 7h20 alors qu’il est censé être borné 080005/215500. Il peut juste sortir de position 24/24 mais ne peut normalement pas en initier 24/24.

    -Pro-order ce matin ne suit plus du tout le backtest, sans doute lié au fait que le backtest a pris une position “hors horaires” .

    Peut-être un problème dans le code ? Je vous soumets une partie de ce code, c’est un peu bricolage, donc possible coquille? Ou je n’accorde pas assez d’importance à l’ordre des conditions, stop & target? Quel est l’ordre idéal?

    A priori, pas de problème dans la sélection du fuseau horaire.

    Merci pour votre aide.

    IF time>080005 and time<215500 and(Not ShortOnMarket AND c10 AND c20 AND c30 and c22 and (c7 or c77)and a and (average[13](cv1)<>0 or average[13](cv2)<>0))or(average[34](pic2)<>0 and average[5](boost)<>0 and highest[21](bl1<=-45)=1 and bl3<-34)AND stlx  THEN
    BUY AT MARKET
    ENDIF
    
    IF time>080005 and time<215500 and(Not LongOnMarket AND c40 AND c50 AND c60 and c2 and (c77 or c7)and b and (average[13](cv1)<>0 or average[13](cv2)<>0))and average[13](boost)=0 AND stsx THEN
    SELLSHORT  AT MARKET
    ENDIF
    
    set stop ploss 21
    set target pprofit 34
    
    if  shortonmarket and ((highest[55](creux1<>0 or creux2<>0 or boost<>0 )=1  ) and bl2<-0 and bl3<40 and TRADEPRICE-TYPICALPRICE>=3 and bl1<-20 and (vcycle<=-0.5 or vcycle2<=-0.5)) then
    exitshort at market
    endif
    if  bl2<40 and highest[21](creux1<>0 or creux2<>0 or boost<>0 or pic2<>0 or inv1<>0 or inv2<>0 or scalp<>0 OR L1<>0 OR L2<>0)=1 and bl2<-20 and bl3<40and bl1<-40and TRADEPRICE-TYPICALPRICE>=11 and (vcycle<=-0.5 or vcycle2<=-0.5)and time>080005 and time<215500  then
    buy   at market
    endif
    if  longonmarket and ((highest[55](creux1<>0 or creux2<>0 or boost<>0  )=1  )and bl2>-0 and bl3>-40 and TRADEPRICE-TYPICALPRICE<=-3 and bl1>20 and (vcycle<=-0.5 or vcycle2<=-0.5))AND STSX then
    sell  at market
    endif
    if   bl2>-40 and highest[21](creux1<>0 or creux2<>0 OR BOOST or pic2<>0 or inv1<>0 or inv2<>0 or scalp<>0 OR S1<>0 OR S2<>0)=1 and bl2>-20 and bl3>-40  and bl1>-40 and TRADEPRICE-TYPICALPRICE<=-11 and (vcycle<=-0.5 or vcycle2<=-0.5) and time>080005 and time<215500  then
    sellshort  at market
    endif
    ///////////////////////////////////
    
    IF (pic2<>0 or inv1<>0 or inv2<>0 or scalp<>0 OR L1<>0 OR L2<>0)=1 and bl2<-20 and bl3<-0and HIGHEST[34](bl1<-40)=1 and (vcycle<=-0.5 or vcycle2<=-0.5)and time>080005 and time<215500 AND XL THEN
    buy   at market
    endif
    IF (pic2<>0 or inv1<>0 or inv2<>0 or scalp<>0 OR L1<>0 OR L2<>0)=1 and bl2>20 and bl3>0and HIGHEST[34](bl1>40)=1 and (vcycle<=-0.5 or vcycle2<=-0.5)and time>080005 and time<215500 AND XL THEN
    SELLSHORT  at market
    endif
    
    #25062 quote
    Victorio
    Participant
    Senior

    A priori il y aurait un problème dans la partie du code suivante? il semblerait que le programme s’emmêle les pinceaux:

    if  shortonmarket and ((highest[55](creux1<>0 or creux2<>0 or boost<>0 )=1  ) and bl2<-0 and bl3<40 and TRADEPRICE-TYPICALPRICE>=3 and bl1<-20 and (vcycle<=-0.5 or vcycle2<=-0.5)) then
    exitshort at market
    endif
    if  bl2<40 and highest[21](creux1<>0 or creux2<>0 or boost<>0 or pic2<>0 or inv1<>0 or inv2<>0 or scalp<>0 OR L1<>0 OR L2<>0)=1 and bl2<-20 and bl3<40and bl1<-40and TRADEPRICE-TYPICALPRICE>=11 and (vcycle<=-0.5 or vcycle2<=-0.5)and time>080005 and time<215500  then
    buy   at market
    endif
    if  longonmarket and ((highest[55](creux1<>0 or creux2<>0 or boost<>0  )=1  )and bl2>-0 and bl3>-40 and TRADEPRICE-TYPICALPRICE<=-3 and bl1>20 and (vcycle<=-0.5 or vcycle2<=-0.5))AND STSX then
    sell  at market
    endif
    if   bl2>-40 and highest[21](creux1<>0 or creux2<>0 OR BOOST or pic2<>0 or inv1<>0 or inv2<>0 or scalp<>0 OR S1<>0 OR S2<>0)=1 and bl2>-20 and bl3>-40  and bl1>-40 and TRADEPRICE-TYPICALPRICE<=-11 and (vcycle<=-0.5 or vcycle2<=-0.5) and time>080005 and time<215500  then
    sellshort  at market
    endif
    #25064 quote
    Nicolas
    Keymaster
    Master

    Vu la quantité de variables liées elles mêmes à des conditions, on va avoir beaucoup de mal à t’aider j’en ai bien peur !

    Victorio thanked this post
    #25066 quote
    Victorio
    Participant
    Senior

    uhuhuh, je m’en doutais… J’espérais que peut-être quelqu’un aurait repéré une coquille genre des parenthèses manquantes ou une formulation erronée qui sauterait aux yeux (sauf aux miens !).

    Cependant il me semble que tout ce qui concerne les horaires est correct. Cette position prise à 7h20 m’étonne. Peut-il confondre un ordre buy(080005-215500) avec un ordre sell(24/24) dans le code ci-dessus?

    Si personne n’a de réponse, ce n’est pas grave, merci tout de même.

    #25068 quote
    Victorio
    Participant
    Senior

    J’en reviens donc à la question subsidiaire, est-il essentiel de respecter un ordre dans le code, puisqu’il est lu de haut en bas?

    defparam / indicateurs appelés / conditions short&buy / conditions sell&exit / stop&take?

    Ou cela n’ a pas d’incidence réelle?

    Merci.

    #25070 quote
    Nicolas
    Keymaster
    Master

    defparam sera toujours placé en premier, même si tu ne le veux pas 🙂

    Pour le reste, il n’y a pas d’ordre formel, mais un ordre uniquement lié à ton code lui même et de la façon dont il doit s’imbriquer. Si tu lances des ordres en début de programme suivant des conditions testées à la fin de celui-ci, alors ce n’est pas correct, car les conditions qui te feront rentrer au marché seront celles de la barre précédente.

    Victorio thanked this post
    #25072 quote
    Victorio
    Participant
    Senior

    Merci Nicolas, j’ai remis dans l’ordre, les conditions buy& sell, avant les conditions sell&exitshort, et  tout roule impeccablement.

    Le problème venait donc de ce désordre. J’ai toujours été assez bordélique, mais à priori ça ne va pas de paire avec la programmation !

    Il est donc nécessaire de respecter un certain ordre, sous peine de voir un super backtest partir en cacahuète sans comprendre pourquoi.

    Capture-d’écran-2017-02-14-à-17.51.32.png Capture-d’écran-2017-02-14-à-17.51.32.png
    #25082 quote
    Victorio
    Participant
    Senior

    Une dernière question, je ne veux pas abuser de ta disponibilité.

    if  bl2<40 and highest[21](creux1<>0 or creux2<>0 or boost<>0 or pic2<>0 or inv1<>0 or inv2<>0 or scalp<>0 OR L1<>0 OR L2<>0)=1 and bl2<-20 and bl3<40and bl1<-40and TRADEPRICE-TYPICALPRICE>=11 and (vcycle<=-0.5 or vcycle2<=-0.5)and time>080005 and time<215500  then
    buy   at market

    Dans le code ci-dessus, j’ai du mal a interpréter le rôle du “TRADEPRICE-TYPICALPRICE>=11”. Que signifie-t-il exactement dans cette phrase de code, qu’impose-t-il comme condition?

    Que les gains latents soient >= à 11 pips, certes, mais par rapport à quel position?La dernière position fermée? ou la condition implique que le système soit en position et au moins = à 11 pips de gain? Si je supprime cette condition, les perfs de mon système s’effondrent de 10%, mais je ne comprends pas pourquoi !

    Merci par avance.

    #25083 quote
    Nicolas
    Keymaster
    Master

    TRADEPRICE sans un numéro de position comme par exemple TRADEPRICE(1), implique que tu utilises le prix d’entrée du trade courant.

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

Problèmes pro-order VS backtest


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Victorio @victorio Participant
Summary

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

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 02/14/2017
Status: Active
Attachments: No files
Logo Logo
Loading...