Sometimes the price passes over a limit order and there is no filling and I want to automate the cancellation process.
I use the unmanaged mode template of the ninjatrader developers of this forum.
This is the command:
if (longEntry == null)
longEntry = SubmitOrderUnmanaged(0,OrderAction.Buy,OrderType.L imit,1, GetCurrentAsk(), 0, oco, "long limit entry");
the price assigned to LimitPrice appears in the oputput window of ninjascript
but in the compilation it does not support "LimitPrice" as a valid value
I have thought about:
if (longEntry == null && shortEntry == null && Position.AveragePrice >= LimitPrice )
{
CancelAll();
}
I would appreciate a solution to cancel orders that are not filled.
thank you.
Comment