Hi there, I'm having difficulty with SystemPerformance.AllTrades.LosingTrades.Count In my code, I have a statement to the effect of:
if (During Trading Hours) AND (SystemPerformance.AllTrades.LosingTrades.Count > 1) then no more trades for the day.
When I load up a chart, and then activate my strategy, the strategy is backrun over all of the bars in the chart. So when the strategy is caught up to the current time, the LosingTrades.Count is already a substantial number. That is, just by activating my strategy in a chart, the strategy executes over all of the bars in the existing chart. From this, LosingTrades.Count is already in a range of 3-7 by the current time. So, given this statement, my strategy then fails to execute any more trades, even though it never executed any trade during real-time.
How can I get the LosingTrades.Count to be set to 0, or effectively employ as a circuit breaker if my strategy makes more than one bad trade, during trading hours? Thanks

Comment