Open Position on exact Price, Problem related about market fluctuation (fast swings in market)

 

Hello All,

I want to make an EA that open position (buy or sell) in exact price,

I use OrderSend(...) function like below:

if(MarketInfo(Symbol(),MODE_BID)==OpenPrice-PIP)
{
        PendSell(Symbol(),lot,MarketInfo(Symbol(),MODE_BID),MagicNumber);
}
if(MarketInfo(Symbol(),MODE_ASK)==OpenPrice+PIP)
{
        PendBuy(Symbol(),lot,MarketInfo(Symbol(),MODE_ASK),MagicNumber);
}

But when market fluctuation and sever swings accrued, EA can't open position in desired Price,

I using slippage in OrderSend Function, But EA still can't open position in specified Price,

How can I do this?

If EA can open position with 1 pip limit of specified Price, It will be excellent.

Thanks for your attention

 
MOFEX:

Hello All,

I want to make an EA that open position (buy or sell) in exact price,

I use OrderSend(...) function like below:

But when market fluctuation and sever swings accrued, EA can't open position in desired Price,

I using slippage in OrderSend Function, But EA still can't open position in specified Price,

How can I do this?

If EA can open position with 1 pip limit of specified Price, It will be excellent.

Thanks for your attention

The only way you can achieve this is to use a trailing entry with limit orders... like a stop-limit with trailing.

Reason: