private int barNumberOfOrder=0;
private double limitpricelong=0; // calculated later--working
if ( <<conditions -- this code is working>>)
{
AtmStrategyCreate(OrderAction.Buy, OrderType.Limit, limitpricelong, 0,
TimeInForce.Day, GetAtmStrategyUniqueId(), "ATM1",
GetAtmStrategyUniqueId());
barNumberOfOrder = CurrentBar;
}
and
if (CurrentBar > barNumberOfOrder + 2)
{AtmStrategyCancelEntryOrder("orderIdValue");}
The problem is: orderIdValue --
I thought this was what matched up to GetAtmStrategyUniqueId());
But that is not the case... the order fires but the order does not cancel because "orderIdValue" does not exist.
How do I cancel this order if it does not fill after 2 bars? I've researched the help topics and thought I had the right code...also not sure why the code GetAtmStrategyUniqueId()); is repeated, but that's how I saw it in the examples and the code works, expect for the cancel part.
I am stuck. Thanks in advance.
Comment