My thoughts and reading the documentation are that a Position Object is updated each time an event occurs.
However if I am say long and get stopped out or fill a target I notice that my Direction filter doesn't go to 0 ( 1 is long , -1 is short set in OnExecutionUpdate)
even though I specifically set Direction to change to 0.
Am I misunderstanding something here?
protected override void OnPositionUpdate(Cbi.Position position, double averagePrice) { .... if(position.MarketPosition == MarketPosition.Flat)//only seems to get called when actually exiting a position { { ChartControl.Dispatcher.InvokeAsync(() => { Direction = 0;// no effect?? ResetBools(); ResetLines(); ResetButtons(); }); } } }
Comment