Limite de gain mensuelle

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

    Bonjour, je voudrais ajouter a ma stratégie une limite de gain mensuelle

    Ça veut dire par exemple quand le gain atteigne les 4% de mon capital alors la le système se bloque pour le reste du moi.

    Merci et bonne soirée

    #160897 quote
    Nicolas
    Keymaster
    Master

    Le code ci-dessous stocke une autorisation de trading dans la variable booléenne “trading” en fonction du rapport entre le capital au début du mois et celui actuel :

    defparam cumulateorders=false
    
    StartCapital = 10000
    
    if month<>month[1] then 
     startprofit=StartCapital+strategyprofit
    endif 
    
    trading = (startcapital+strategyprofit)/startprofit < 1.04 
    
    if trading then //trading is allowed
     //put strategy here
     if rsi[14]crosses over 50 then 
      buy 2 contracts at market 
      set target pprofit 100
      set stop ploss 50
      endif
    endif
    
    graph trading as "authorize trading"
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Limite de gain mensuelle


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
chelmax @chelmax Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
5 years ago.

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