Nouveau scalping Dax 5 min

Viewing 15 posts - 16 through 30 (of 46 total)
  • Author
    Posts
  • #121664 quote
    Nicolas
    Keymaster
    Master

    Voilà, je pense que tout y est, à vérifier.

    DEFPARAM CumulateOrders = False // Cumul des positions désactivé
    DEFPARAM FLATBEFORE = 090000
    DEFPARAM FLATAFTER = 113000
    
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    if intradaybarindex=0 then 
    startbar=barindex
    //xgain=0
    endif
    if time<=113000 then 
    xgain=summation[max(1,barindex-startbar)](strategyprofit>strategyprofit[1])
    xperte=summation[max(1,barindex-startbar)](strategyprofit<strategyprofit[1])
    c3 = xgain<2 and xperte=0 //condition c3 le matin, aucun order après perte ou 1 gain accepté
    else
    c3 = 1 //toujours vrai après 11h30 si jamais on supprime le FLATAFTER
    endif
    
    // Conditions pour ouvrir une position acheteuse
    buyc = CALL "scalper achat" 
    sellc = CALL "scalper vente"
    c1 = (buyc >= 1)
    c2 = (sellc >= 1)
    
    // ACHAT 
    IF not longonmarket and c1 and c3 AND not daysForbiddenEntry THEN
    BUY 2 CONTRACT AT MARKET
    buysl = low[3] //enregistre le sl pour order achat 
    sell at buysl stop //place le sl sur la première bougie 
    ENDIF
    
    IF c2 THEN
    SELL AT MARKET
    ENDIF
    
    // VENTE 
    IF not shortonmarket and c2 and c3 AND not daysForbiddenEntry THEN
    SELLSHORT 2 CONTRACT AT MARKET
    sellsl = high[3]
    exitshort at sellsl stop 
    ENDIF
    
    iF c1 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    //stop loss (place les SL en continue tant qu'on est au marché)
    if longonmarket then
    sell at buysl stop
    endif
    if shortonmarket then 
    exitshort at sellsl stop 
    endif 
    
    //graphonprice buysl
    //graphonprice sellsl coloured(255,0,0)
    //graph xgain
    //graph startbar
    //graph max(1,barindex-startbar)
    //graph strategyprofit>strategyprofit[1]
    //graph time
    #121679 quote
    dzim0050
    Participant
    Average

    Merci. Je viens de faire un backtest avec un ratio gains/pertes de 1,8 % relativement bon, mais les positions perdantes sont supérieures au position gagnantes. Je regarde dans l’après-midi cela en détail et te teins au courant. Merci.

    #121805 quote
    dzim0050
    Participant
    Average

    Bonjour Nicolas. Voilà je viens d’en finir. Ma stratégie est basée sur une tendance que le Dax tente d’établir à partir de 9h. Sachant que les indices  en Europe attendent presque tout le temps l’ouverture de Wall Street ils se mettent souvent en range à partir de 11h30 environ. J’ai choisi le Dax parce qu’il est la marché maître en Europe et le plus représentatif de la santé de l’économie dans la zone Euro.

    J’ai remarqué que ce n’est qu’à partir de 9h la tendance s’établit ( si toute fois ) mais cela personne ne peux le savoir bien sûr . Dans le backtest certain signaux ont été enclenchés  déjà à l’ouverture de la bougie de 9h, ce que je ne souhaite pas. J’ai aussi remarqué que les positions enclenchées après 11h était inutiles.

    Je souhaiterai modifier le code en insérant des conditions supplémentaires qui intégreraient un meilleur money management en plus des conditions nommées ci-dessus.

    Les voici justement : * ne prendre en considération comme 1ère bougie du signal de la série de 3 ( hausse où baisse ) celle de 9h et pas avant donc.

    * ne plus ouvrir de position après 11h

    * la 1ère position doit être initiée avant 10h15 ( cela permettra encore à la tendance de s’établir )

    * si la première position a été gagnante au-delà des 1 % de mon capital ( que je veux modifier ) alors je veux rester flat

    * si la première position a au contraire été perdante au-delà de ces 1 % alors là aussi je rester flat.

    Avec ces modifications j’aurais éliminées plusieurs positions perdantes et améliorer le ratio gains/pertes et le ratio positions gagnantesµ/perdantes. Mais aussi mieux intégrer le money management.

    D’avance merci pour ton aide qui m’a déjà été précieuse. Denis

    #121817 quote
    Nicolas
    Keymaster
    Master

    Voilà dans les grandes lignes ce que ça peut donner. Je pense que tout y est. Bon courage.

    DEFPARAM CumulateOrders = False // Cumul des positions désactivé
    DEFPARAM FLATBEFORE = 091500
    DEFPARAM FLATAFTER = 110000
    
    capital = 1000 //capital au lancement 
    GainPerteMax = 1 //perte/gain max en %
    
    timecondition = time>=091500 and time<110000
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    if intradaybarindex=0 then
    startbar=barindex
    ordercount=0
    startbalance=capital+strategyprofit
    endif
    firstpos=time<=101500 or ordercount>0
    if time<=110000 then
    xgain=summation[max(1,barindex-startbar)](strategyprofit>strategyprofit[1])
    xperte=summation[max(1,barindex-startbar)](strategyprofit<strategyprofit[1])
    c3 = xgain<2 and xperte=0 //condition c3 le matin, aucun order après perte ou 1 gain accepté
    else
    c3 = 0 //aucune position après 110000
    endif
    
    todaypnl = ((capital+strategyprofit)/startbalance-1)*100
    todaystop = (todaypnl<=gainpertemax/100 or todaypnl>=gainpertemax/100) and todaypnl<>0
    
    // Conditions pour ouvrir une position acheteuse
    buyc = CALL "scalper achat"
    sellc = CALL "scalper vente"
    c1 = (buyc >= 1)
    c2 = (sellc >= 1)
    
    // ACHAT
    IF timecondition and not longonmarket and c1 and c3 and firstpos and not daysForbiddenEntry  THEN
    //exitshort at market 
    floatingprofit = (((close-positionprice)*pointvalue)*countofposition)/pipsize //actual trade gains
    todaypnl = ((capital+strategyprofit+floatingprofit)/startbalance-1)*100
    todaystop = (todaypnl<=gainpertemax/100 or todaypnl>=gainpertemax/100) and todaypnl<>0
    if not todaystop then 
    BUY 2 CONTRACT AT MARKET
    endif
    buysl = low[3] //enregistre le sl pour order achat
    sell at buysl stop //place le sl sur la première bougie
    ordercount=ordercount+1
    endif
    IF c2 THEN
    SELL AT MARKET
    ENDIF
    
    // VENTE
    IF timecondition and not shortonmarket and c2 and c3 and firstpos and not daysForbiddenEntry and not todaystop THEN
    floatingprofit = (((close-positionprice)*pointvalue)*countofposition)/pipsize //actual trade gains
    todaypnl = ((capital+strategyprofit+floatingprofit)/startbalance-1)*100
    todaystop = (todaypnl<=-gainpertemax/100 or todaypnl>=gainpertemax/100) and todaypnl<>0
    if not todaystop then
    SELLSHORT 2 CONTRACT AT MARKET
    endif
    sellsl = high[3]
    exitshort at sellsl stop
    ordercount=ordercount+1
    endif
    iF c1 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    //stop loss (place les SL en continue tant qu'on est au marché)
    if longonmarket then
    sell at buysl stop
    endif
    if shortonmarket then
    exitshort at sellsl stop
    endif
    
    
    //graph todaystop
    //graph todaypnl
    //graph ordercount 
    //graph firstpos
    //graphonprice buysl
    //graphonprice sellsl coloured(255,0,0)
    //graph xgain
    //graph startbar
    //graph max(1,barindex-startbar)
    //graph strategyprofit>strategyprofit[1]
    //graph time
    Fantasio2020 thanked this post
    #121851 quote
    dzim0050
    Participant
    Average

    Travail de professionnel Nicolas, un très grand merci. Le ratio gains/pertes est passé de 1,8 % à 3 % et le ratio positions gagnantes/perdantes est passé de 44 % à 57 %. Je vais le laisser tourner en démo et en même temps  regarder ce que je pourrais encore améliorer.

    Le capital est passé de 10 000 € ( base ) à 12048 € du 01.01 à aujourd’hui avec un levier de 2,6 environ lorsque le Dax était à ses plus hauts, à 2 environ depuis la chute dû à la crise du coronavirus. Il est vrai que les gains les plus importants ont été réalisés depuis le début de la crise. Le marché étant avant cela plutôt dans un range. A voir.

    Merci et bonne fin d’après midi. Denis.

    #121860 quote
    dzim0050
    Participant
    Average

    Nouveau backtest de puis le 01/11/2018 ( vue 100 000 unités ) le ratio gains/pertes est de 1,78 % et le ratio positions gagnantes/perdantes de 47,26 %. Intéressant aussi.

    Screen-Shot-03-11-20-at-06.23-PM.png Screen-Shot-03-11-20-at-06.23-PM.png
    #121862 quote
    dzim0050
    Participant
    Average

    le screen du nouveau code depuis le début d’année

    Screen-Shot-03-11-20-at-05.27-PM.png Screen-Shot-03-11-20-at-05.27-PM.png
    #122493 quote
    bertholomeo
    Participant
    Veteran

    Bonjour dzim0050,

    Est il possible de poster le fichier du code ainsi que le code de l’indicateur ?
    Merci

    #122770 quote
    dzim0050
    Participant
    Average

    Bonsoir Bartholomeo. Ci joint le fichier

    nouveau-Dax-II-5-min.itf
    #122836 quote
    Florian
    Participant
    Senior

    Bonjour DZIM0050,

     

    Le fichier ITF n’est plus valide il est possible de le publier de nouveau merci ? Avez vous essayer de l’automatiser ?

     

    Cordialement

    Florian

    #123170 quote
    dzim0050
    Participant
    Average

    Bonjour Florian. Je ne préfère pas automatiser la stratégie en ce moment avec la volatilité et les spreads trop larges. De plus je viens de terminer la lecture de toutes les positions exécutées par le système en backtest et bien celles perdantes afin de comprendre ce qui pourrait être améliorer afin d’augmenter les ration positions gagnantes/perdantes encore trop bas. Les gains les plus conséquents  ont été ceux réalisés juste avant le déclenchement de la chute vertigineuse.

    #123174 quote
    dzim0050
    Participant
    Average

    Ci-joint le backtest depuis le 01/01/2018 jusqu’au 28/02/2020

    Florian thanked this post
    Screen-Shot-03-24-20-at-05.13-PM.png Screen-Shot-03-24-20-at-05.13-PM.png Screen-Shot-03-24-20-at-05.15-PM.png Screen-Shot-03-24-20-at-05.15-PM.png
    #123178 quote
    Florian
    Participant
    Senior

    Effectivement ça demande à être optimisé Si tu veux partager je peux peut être le compléter par une enveloppe de Scalping DAX qui colle sur ce TF, et éventuellement un jeux de scalping complémentaire pour éviter les faux signaux.

     

    A+

     

    Flo

    #123179 quote
    dzim0050
    Participant
    Average

    Je veux bien, mais comment.. Est-tu programmateur ?

    #123183 quote
    Florian
    Participant
    Senior

    Oui enfin à mon petit niveau mais j’ai déjà des choses interessante de réalisé.

     

    Après il va falloir harmoniser tout ça

Viewing 15 posts - 16 through 30 (of 46 total)
  • You must be logged in to reply to this topic.

Nouveau scalping Dax 5 min


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
dzim0050 @dzim0050 Participant
Summary

This topic contains 45 replies,
has 4 voices, and was last updated by phoentzs
4 years ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 03/09/2020
Status: Active
Attachments: 19 files
Logo Logo
Loading...