How to set a weekly profit and no operate until Next week?
Thanks!
- Firstly reset your profit at the beginning of each weeek (the first bar whose OpenDayOfWeek = 1) and re-enable trading
- Secondly monitor when STRATEGYPROFIT exceeds your weekly Gains and, if so, disable further trading using a variable named TRADEON
There you go:
ONCE MyProfit = 0 //Use this variable to tell when your profit exceeds X
ONCE TradeON = 1 //1=trading enabled, 0=trading disabled
ONCE X = 500 //500 € max weekly profit
IF OpenDayOfWeek = 1 AND OpenDayOfWeek[1] <> 1 THEN //at week start
MyProfit = StrategyProfit //save the total profit at the start of the week
TradeON = 1 //re-enable trading
ENDIF
IF (StrategyProfit - MyProfit) >= X THEN
TradeON = 0 //disable trading after X € gained
ENDIF
IF MyLongConditions AND Not OnMarket ANd TradeON THEN //add TradeON as an additional condition to enter a tarde
BUY 1 Contract AT Market
ENDIF
At line 3 use a percentage (1, 2, 3.5, etc…) instead of money.
Replace line 8 with:
IF (StrategyProfit - MyProfit) >= abs(MyProfit * X / 100) THEN