I have just started with NinjaTrader and created my first strategy. The strategy trades FAS and FAZ and the rule is that at any given time I can only have a position open in either FAS or FAZ.
In the Positions property I have two entries: 0 for FAS and 1 for FAZ.Then, OnBarUpdated, I check Positions[opposite].MarketPosition == MarketPosition.Flat (where opposite is the index of the non-current symbol) in order to safeguard from entering positions in both FAS and FAZ at the same time.
Here is the problem. On this one date, I enter FAZ, and then, for some reasons, the strategy keeps entering FAS. I debugged it in VS 2010 and I can see that after EnterLong for FAZ is called on consequent calls to OnBarUpdated, the MarketPosition for FAZ is still shows Flat.
Not sure where to take it from here? Why is the MarketPosition not updated to Long after calling EnterLong on FAZ?
Thanks.
Evgueni
Comment