MQL5 Buy limit at ask price-> Return code:10015

 

Hi All,

I would like to buy at the current ask price in my MT5 platform at AMPGlobalEU broker. I do not want to use market order because I could get slippage. My goal is to take the trade at the actual ASK price or not take it at all. How can I do that?

(action:TRADE_ACTION_PENDING, order type:ORDER_TYPE_BUY_LIMIT, price=ASK price)

I thought placing a BUY limit order at ASK will do the job, but instead I get Return code:10015. I can place BUY limit below the best BID, at  best BID or between best BID and ASK, but not at ASK price.

Is there a way I could achieve this?

Thanks

 
MrGekko1:

Hi All,

I would like to buy at the current ask price in my MT5 platform at AMPGlobalEU broker. I do not want to use market order because I could get slippage. My goal is to take the trade at the actual ASK price or not take it at all. How can I do that?

(action:TRADE_ACTION_PENDING, order type:ORDER_TYPE_BUY_LIMIT, price=ASK price)

I thought placing a BUY limit order at ASK will do the job, but instead I get Return code:10015. I can place BUY limit below the best BID, at  best BID or between best BID and ASK, but not at ASK price.

Is there a way I could achieve this?

Thanks

you cannot BUY LIMIT at the Ask because it will be too close the market price ie: zero distance.

you cannot avoid slippage in FX

you can only avoid it in other products if your broker supports Fill or Kill at set price, but then you risk not getting filled and by the time you have tried again price has moved anyway = slippage