When I try to create a BuyStops of BuyLimit order which is too close to the current Ask price (even though the price I want to buy at is the correct side of the Ask price) I get an invalid price error.
Is there any way I could detect when this will happen before attempting the order?
Articles:

- www.mql5.com
When I try to create a BuyStops of BuyLimit order which is too close to the current Ask price (even though the price I want to buy at is the correct side of the Ask price) I get an invalid price error.
Is there any way I could detect when this will happen before attempting the order?
Interestingly, by posting the question, the mql5 website came up with a suggestion that have me the answer:
https://www.mql5.com/en/articles/2555#modify_in_freeze_level_prohibited

- www.mql5.com
Articles:
Hi Vladimir,
Sorry I haven't responded properly. I dropped this for a while but I'm now back working on it.
Your first link helped my solve my problem as I was using the wrong Ask/Bid price when calculating my stop loss and take profit. The specific documentation that made me realise was:
- Buying is done at the Ask price — the TakeProfit and StopLoss levels should be compared to the Bid price.
- Selling is done at the Bid price — the TakeProfit and StopLoss levels should be compared to the Ask price.
Regards
Chris.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
When I try to create a BuyStops of BuyLimit order which is too close to the current Ask price (even though the price I want to buy at is the correct side of the Ask price) I get an invalid price error.
Is there any way I could detect when this will happen before attempting the order?