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
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"