I looked through the Ninja trace log and the PositionUpdateCallback() entries match with my OnPositionUpdate() logs. I would expect a PositionUpdateCallback() for each ExecutionUpdateCallback() but that is not the case. I noticed several ExecutionUpdateCallback() entries before a PositionUpdateCallback().
The strat will sometimes place a new market order while in the OnPositionUpdate() callback if the signal is still in effect. Is that OK or should I use a TriggerCustomEvent() to let the strat unwind and then place new orders?
Also from the trace logs I see OnPositionChanged() entries with netPosition=1, then -1, then -3. Not a sequential move from 1,0,-1,-1,-2,-3. Any explanation will help. The docs state OnPositionUpdate will be called for every position change. That is true but the delay is not desired.
Comment