Hi Guys,
does anyone have an idea of how to count consecutive losing trades. For example I want to stop trading if I take 3 losses in a row (i.e. one after the other), not a total of 3 losses for the day, but 3 losses in a row.
Any ideas on how to code this out would be greatly appreciated
Thanks
Use STRATEGYPROFIT.
if strategyprofit < strategyprofit[1] then
count = count + 1
endif
if strategyprofit > strategyprofit[1] then
count = 0
endif
if count = 3 and (what ever condition you set to start trading again) then
count = 0
endif
If (your entry conditions) and count < 3 then
buy 1 contract at market
endif
Thanks Vonsai. I tried that but StrategyProfit seems to be incorrectly counting losing trades. Look at the first example, the trade is profitable albeit a tiny profit but the counter counts it as a losing trade. Any idea what this happens?