PDA

View Full Version : Problem with MarketPosition.Flat


zoltran
04-10-2007, 06:07 AM
I'm pretty sure there is a problem with MarketPosition.Flat

This works .. for determining if I'm not in a Long or Short ...

if (Position.MarketPosition != MarketPosition.Short && Position.MarketPosition != MarketPosition.Long )

But this seems to be a no-op
if (Position.MarketPosition == MarketPosition.Flat)

6 b2 Plus Dierks mods from last week

NinjaTrader_Ray
04-10-2007, 06:29 AM
I am 100% positive that it does work.

Try this:

Print(Position.MarketPosition.ToString());
if (Position.MarketPosition == MarketPosition.Flat)
Print("Confirm I am flat");
Ray

zoltran
04-10-2007, 06:49 AM
Of course you are right.
I had the strategy running on two charts and I was seeing the debug output from a 'flat' strategy mixed in my long output.

A second question ...

Is there a method I can use to determine the active instrument?

NinjaTrader_Ray
04-10-2007, 06:57 AM
Do you mean printing out what Instrument the strategy is running? If yes, try this -

http://www.ninjatrader-support.com/HelpGuideV6/InstrumentFullName.html

Ray