Arreter un robot au bout de 3 trades gagnants

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #187792 quote
    netskiss
    Participant
    Average

    Bonjour,

    J’aimerai couper mon robot au bout de 3 trades gagnants.

    J’ai utilisé le code suivant :

    if intradaybarindex=0 then
    bartoday = barindex
    endif
    
    if positionperf(1) < 0 and tradeindex(1)>bartoday THEN
    notrading = 0
    ELSE
    
    count = 0
    for i = 0 to trademax do
    if tradeindex(i)>bartoday then
    if positionperf(i)>0 then
    count=count+1
    endif
    endif
    next
    
    notrading = count>=trademax
    ENDIF
    
    GRAPH count

     

    Mais j’ai un problème j’aimerai que la variable count ne s’incrémente qu’à la fin du trade gagnant et pas entre deux trades (voir pièce jointe)

    Merci beaucoup à tous

    🙂

    Sans-titre-1.jpg Sans-titre-1.jpg
    #187794 quote
    netskiss
    Participant
    Average

    j’ai oublié de préciser trademax = 3

    #187796 quote
    netskiss
    Participant
    Average
    once trademax = 3
    
    if intradaybarindex=0 then
    bartoday = barindex
    endif
    
    
    if positionperf(1) < 0 and tradeindex(1)>bartoday THEN
    notrading = 0
    ELSE
    
    
    count = 0
    for i = 1 to trademax do
    if tradeindex(i)>bartoday then
    if positionperf(i)>0 then
    count=count+1
    endif
    endif
    next
    
    
    notrading = count>=trademax
    ENDIF
    
    
    GRAPH count

    Excusez-moi j’ai fait une correction car je mettais trompée.

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

Arreter un robot au bout de 3 trades gagnants


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
netskiss @netskiss Participant
Summary

This topic contains 2 replies,
has 1 voice, and was last updated by netskiss
4 years ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 02/07/2022
Status: Active
Attachments: 1 files
Logo Logo
Loading...