Arreter un robot au bout de 3 trades gagnants

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #187792 quote
    netskissnetskiss
    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
    netskissnetskiss
    Participant
    Average

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

    #187796 quote
    netskissnetskiss
    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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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 netskissnetskiss
4 years, 8 months ago.

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