PDA

View Full Version : IOrder


trend
02-17-2009, 03:47 PM
If I have an Exit IOrder
XL0=ExitLong(1,"XL0","L0");
do I have to set XL0 back to null upon execution

with
protectedoverridevoid OnExecution(IExecution execution)
{

if (execution.Order.Name == "XL0")
{

if (execution.Order.OrderState == OrderState.Filled)
{
XL0 =
null;
}
in order to avoid the "Terminal Exit Order already in place..." message

Thx

NinjaTrader_Bertrand
02-18-2009, 05:28 AM
Yes, you want to set those to null when using IOrder - see also this reference sample here - http://www.ninjatrader-support2.com/vb/showthread.php?t=7499

trend
02-18-2009, 09:43 AM
How is OrderState Ignored captured as:

Cancelled, Rejected, UnKnown?

Also, when
L1=EnterLong("L1");
is Filled or PartFilled
does L1 revert automatically to NULL?

NinjaTrader_Bertrand
02-18-2009, 10:12 AM
Your initial order expires and is cancelled, this is why subsequent ones get ignored.

It is not automatically set to null, as you can see in the snippet for the IOrder help - http://www.ninjatrader-support.com/HelpGuideV6/IOrder.html