I am using the two commands in one of the IF statements
Position.MarketPosition == MarketPosition.Flat
PositionAccount.MarketPosition == MarketPosition.Flat
I get an unstable response. While the IB account is in a short position due to some other strategy , I get the response jumping from FLAT to SHORT with irregular frequency. most of the time is FLAT. during the test , nothing is actually happening. no new positions and no change in orders. constant SHORT position in IB account.
Is this known behaviour ? is there some other way to get the status of the IB account ?
Thanks
Comment