The simplest answer is : anything to do with Buy will be Ask, and anything to do with Sell will be Bid.
Hi
and should I care about the distance between current market price and pending order SL and TP ?
Ideally, you should code somewhere to alter SL and TP prices accordingly AFTER the pending order has been executed, to take into account price slippages.
The simplest answer is : anything to do with Buy will be Ask, and anything to do with Sell will be Bid.
Ideally, you should code somewhere to alter SL and TP prices accordingly AFTER the pending order has been executed, to take into account price slippages.
Thanks Seng Joo Thio
But not always.
For buy you will enter with Ask and exit with Bid
For sell you will enter with Bid and exit with Ask
Your second suggestion is good, this is what i'm doing usually ,thanks
But I'm trying to learn more about it.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi
I need to check stop level before sending OP_BUY_STOP and OP_SELL_STOP.
But I'm not sure about the price which I should check for distance and compare to stop level,
is it ask for buy stop and bid for sell stop?
and should I care about the distance between current market price and pending order SL and TP ?
if yes, please tell me which price should be used for any of them.
Thanks
Added a day later:
I think for Buy pending orders, in the future when the price arrived, it will be executed with Ask, So I guess I need to check the current Ask to be far enough from the price which I want to place my buy pending order, and for Pending sells vice versa.
Is it correct?