PDA

View Full Version : When NT closes a position


cassb
05-25-2010, 08:32 PM
In my strategy, I want to keep track of its profit/loss since the strategy was started. I can do this in the OnExecution tag using the execution.Price and execution.Quantity to compare with a local array I have of the entry price and quantity, which is subscripted by execution.Order.FromEntrySignal.

However, when NinjaTrader closes a position, like when you have Exit On Close set to true, the execution object doesn't seem to have any connection to the FromEntrySignal that opened the order. execution.Order.Name is also not the same as the name I gave the order when it was placed. So I have no way to get the order's entry price or quantity.

Is there a way to do this?

Thanks!
Bryan

NinjaTrader_Bertrand
05-26-2010, 05:42 AM
Hi Bryan, for the realtime strategy performance, couldn't you just use the RealtimeTradesCollection from the Performance class?

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