Which Price should be checked for stop level when you open a pending order ?

 

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?

Basic Principles - Trading Operations - MetaTrader 5
Basic Principles - Trading Operations - MetaTrader 5
  • www.metatrader5.com
is an instruction given to a broker to buy or sell a financial instrument. There are two main types of orders: Market and Pending. In addition, there are special Take Profit and Stop Loss levels. is the commercial exchange (buying or selling) of a financial security. Buying is executed at the demand price (Ask), and Sell is performed at the...
 

The simplest answer is : anything to do with Buy will be Ask, and anything to do with Sell will be Bid.

Reza nasimi:

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.

 
Seng Joo Thio:

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.

Reason: