how to open a pending order after a gap

 

when market is highly volatile, it happens that a pending order with 0 slippage is not opened because the rate jump over the OrderOpenPrice of this pending order.
Which trading function has to be used by the Expert to open this order at the new rate ?

i.e. : rate at 1.2600
pending order sell limit at 1.2605
rate gap to 1.2612 without touching the exact rate 1.2605
how to open the sell order at this new rate 1.2612 ?
is it necessary to delete the pending order SELL_LIMIT at 1.2605 and do a sendorder SELL at 1.2612 ?
or can the pending order SELL_LIMIT be executed instantly ? how ?

thanks

 

I find myself with the same issue and am in the middle of trying various approaches. The only way I have found so far is to change the pending order to a market order (after RefreshRates) and resend it. You can modify the open price of a pending order but then you are caught in the no-fly zone (error 130 meaning your price is too close to the market and you must use a market order). There are brokers that advertise 1 pip no-fly zones but I don't know how reliable they are or what the fine print really says you can do.

Scott

flag wrote:

when market is highly volatile, it happens that a pending order with 0 slippage is not opened because the rate jump over the OrderOpenPrice of this pending order.
Which trading function has to be used by the Expert to open this order at the new rate ?

i.e. : rate at 1.2600
pending order sell limit at 1.2605
rate gap to 1.2612 without touching the exact rate 1.2605
how to open the sell order at this new rate 1.2612 ?
is it necessary to delete the pending order SELL_LIMIT at 1.2605 and do a sendorder SELL at 1.2612 ?
or can the pending order SELL_LIMIT be executed instantly ? how ?

thanks

 
Ps. If you resend a market order you have to cancel the original pending order because you can only change the open price and expiration with an .

ScottB
wrote:

I find myself with the same issue and am in the middle of trying various approaches. The only way I have found so far is to change the pending order to a market order (after RefreshRates) and resend it. You can modify the open price of a pending order but then you are caught in the no-fly zone (error 130 meaning your price is too close to the market and you must use a market order). There are brokers that advertise 1 pip no-fly zones but I don't know how reliable they are or what the fine print really says you can do.

Scott

Reason: