Bonjour, je voudrais quelle mettre dans ma strategie pour fermer tout le position quand le gain journalier est atteint ?
Par exemple: quand ma strategie atteint 200 euro de gain possitif je voudrais que tout autre possible se ferme et que d’autre ne s’ouvre pas.
Le voici, pour le réactiver il faut mettre TradeON = 1 selon vos besoins:
Once TradeON = 1
Once MaxProfit = 200 //200€ max profit
Once MyProfit = 0
If MyRestartConditions Then
TradeON = 1
Endif
If IntraDayBarIndex = 0 Then
MyProfit = StrategyProfit
Endif
If (StrategyProfit - MyProfit) >= MaxProfit then
TradeON = 0
Endif
If MyLongConditions And TradeON then
Buy 1 contract at Market
Endif