View Full Version : Account Positions
Is there an accessible property to return REAL account positions within a NinjaScript Strategy?
The value I'm looking for is the same as displayed in the SuperDom.
Json
NinjaTrader_Ray
04-02-2007, 08:24 AM
See this thread - http://ninjatrader.mywowbb.com/forum3/1774.html
Tried -
Cbi.Position myPosition = Account.Positions.FindByInstrument(Instrument);
if (myPosition != null)
Print(myPosition.Quantity);
else
Print("There is no position");
Log Showed -
Error on calling 'OnBarUpdate' method for strategy 'Test': Object reference not set to an instance of an object.
NinjaTrader_Dierk
04-02-2007, 04:47 PM
I just applied the code lines below to a blank sample strategy no problem. -> The issue you experienced likely is related to something different.
Please try finding the cause by (a) eliminating the other code from your strategu or (b) building a new startegy, coping code below first and then adding you other custom code step by step.