I've used the Ninjascript order cancel example from 2015 to build the code. Maybe it's dated and doesn't work with NinjaTrader 8. Anyway, here's my code which doesn't actually cancel pending orders:
if (Position.MarketPosition == MarketPosition.Flat)
{
if (entryOrderLONG == null && LONG1buttonClicked == true && Close1UP == true)
{ EnterLongLimit(Convert.ToInt32(DefaultQuantity), Close[1], @"entryLONG");
LastTradeCount = CurrentBar; }
else if (entryOrderLONG != null && CancelbuttonClicked == true)
{ CancelOrder(entryOrderLONG);}
}
Any suggestions to end my banging my head against the wall experience?
Thanks in advance.
Comment