Plus de prise de position après pertes consécutives ou montant de perte en euros

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #96440 quote
    Lorenzodb22Lorenzodb22
    Participant
    Junior

    Bonjour,

    Je voudrai indiquer dans mon code qu’après une perte de 6 positions d’affilées ou une perte cumulée allant jusqu’à 2000€ par exemple le robot ne prenne plus de position.

    D’avance merci pour votre aide

    #96468 quote
    NicolasNicolas
    Keymaster
    Legend

    Tu peux compter la quantité d’ordre perdante en comparant le STRATEGYPROFIT à chaque nouvelle barre:

    if strategyprofit <> strategyprofit[1] then //la balance change 
     if positionperf(1)<0 then //si dernière position perdante 
      perte=perte+1 //alors on incrémente la quantité de perte 
     else //si elle est positive 
      perte=0 //alors le compte est remis à zéro 
     endif
    endif

    ensuite on peut QUIT la stratégie si perte = 6 ou STRATEGYPROFIT est inférieur à -2000, soit :

    if perte >=6 or strategyprofit<-2000 then 
     QUIT 
    endif
Viewing 2 posts - 1 through 2 (of 2 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

Plus de prise de position après pertes consécutives ou montant de perte en euros


ProOrder : Trading Automatique & Backtests

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by NicolasNicolas
7 years, 6 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 04/14/2019
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...