As far as I understand it, the Reference Sample: "Strategy: Stopping a strategy after consecutive losers" (the code downloads as an NJ snippet called "SampleTradeObjects") works fine unless there are partial fills.
In the sample code, the strategy stops entering positions if the last three consecutive trades were losers.
However, if a single trade results in 3 partial fills, and if all those partial fills are stopped out, then the 3-losers-in-a-row condition will be triggered, when it's "really" just one trade.
I am trying to determine the best approach to modifying this snippet so that partial fills don't get treated as separate trades, but instead get lumped together to be treated as a single trade for the purpose of evaluating this condition.
Any suggestions as to the best way forward?
Thanks
Comment