PDA

View Full Version : MarketPosition with multi-instrument strategy


richp6
10-07-2010, 08:13 AM
Hi,

I have a strategy that I'm running fine, but I just added multi-instrument to it. I'm running the strategy on the ES chart. When I do a check of MarketPosition, and I'm flat on ES but long AAPL for example, I get a reading of MarketPosition being flat.

I'm sure this is an easy fix, but I couldn't find it in the documentation. How do I check the MarketPosition of AAPL (assuming it is my 2nd instrument and ES is my first)?

Thanks,

Rich

NinjaTrader_RyanM
10-07-2010, 08:38 AM
Hello Rich,

You use Positions[x] (http://www.ninjatrader-support.com/HelpGuideV6/Positions.html) , where x is the series index.

if (Positions[1].MarketPosition == MarketPosition.Long)
Print(Positions[1].MarketPosition.ToString());