zeller4
07-23-2010, 06:21 AM
Hello,
I'm using the SampleATMStrategy and have looked for ways to "guarantee" a fill of a limit order.
With a 50 tick chart:
When a candle "straddles" the entry price, the fill works with the first part.
However, sometimes the High[1] == entryPriceL and Low[0] == entryPriceL so those candles don't "straddle" the entry price and wouldn't necessarily give a filled condition.
I've tried using this but not sure the logic is right:
if ((High[0] > entryPriceL && Low[0] < entryPriceL)||
(High[1] >= entryPriceL && Low[1] <= entryPriceL)
)
{
longFilled = true;
}
if (longFilled)
AtmStrategyCreate(Cbi.Action.Buy, OrderType.Limit, entryPriceL, 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", atmStrategyId);
Is there a better way to ensure a fill?
Thanks,
Kirk
I'm using the SampleATMStrategy and have looked for ways to "guarantee" a fill of a limit order.
With a 50 tick chart:
When a candle "straddles" the entry price, the fill works with the first part.
However, sometimes the High[1] == entryPriceL and Low[0] == entryPriceL so those candles don't "straddle" the entry price and wouldn't necessarily give a filled condition.
I've tried using this but not sure the logic is right:
if ((High[0] > entryPriceL && Low[0] < entryPriceL)||
(High[1] >= entryPriceL && Low[1] <= entryPriceL)
)
{
longFilled = true;
}
if (longFilled)
AtmStrategyCreate(Cbi.Action.Buy, OrderType.Limit, entryPriceL, 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", atmStrategyId);
Is there a better way to ensure a fill?
Thanks,
Kirk