Cómo make if there are two consecutive operations with losses stop operating until the Next day.
You can create a condition that count the strategyprofit decrease occurrence in the current day:
test = summation[max(1,intradaybarindex)](strategyprofit<strategyprofit[1]) //count how many times the strategyprofit has decreased today
if test < 2 and buycondition then
buy at market
endif
Not tested, please do and give feedback.
Not tested:
Once TradeON = 1
Once Count = 0
If IntraDayBarIndex = 0 then
TradeON = 1
Count = 0
Endif
If StrategyProfit < StrategyProgit[1] then
Count = Count + 1
Elsif StrategyProfit > StrategyProgit[1] then
Count = 0
Endif
If Count >= 2 then
TradeON = 0
Endif
If MyLongConditions and TradeON then
Buy 1 contract at market
Endif
Links to above added as Log 202 here …
Snippet Link Library