Ask vs Bid Prices

 

Hi, 


For backtesting and setting the SL and TP values in OrderSend, does it matter significantly if I use Ask or Bid as part of the SL and TP calculation?  I don't see any errors when I use either one. I know other posts said #1 is the correct way, but is that only for live trading?


For instance, 

OrderSend(Symbol(), OP_BUY, tradesize, Ask, 0, Bid-30, Bid+15, NULL, 0, Green)   //1

OrderSend(Symbol(), OP_BUY, tradesize, Ask, 0, Ask-30, Ask+15, NULL, 0, Green)   //2
 
drinkyd:

For backtesting and setting the SL and TP values in OrderSend, does it matter significantly if I use Ask or Bid as part of the SL and TP calculation?  I don't see any errors when I use either one. I know other posts said #1 is the correct way, but is that only for live trading?

For instance, 

There won't be error, since your values are well beyond what is acceptable. Try Bid+15*Point instead...

 
  1. OrderSend(Symbol(), OP_BUY, tradesize, Ask, 0, Bid-30, Bid+15, NULL, 0, Green)   //1
    As Seng pointed out. If the market is at 1.2345 your SL is negative.

  2. OrderSend(Symbol(), OP_BUY, tradesize, Ask, 0, Ask-30, Ask+15, NULL, 0, Green)   //2

    You buy at the Ask and sell at the Bid. So for buy orders you pay the spread on open. For sell orders you pay the spread on close.
    1. Your buy order's TP/SL (or Sell Stop's/Sell Limit's entry) are triggered when the Bid reaches it. Not the Ask. Your SL is shorter by the spread and your TP is longer. Don't you want the same/specified amount for either direction?
    2. Your sell order's TP/SL (or Buy Stop's/Buy Limit's entry) will be triggered when the Ask reaches it. To trigger at a specific Bid price, add the average spread.
                MODE_SPREAD (Paul) - MQL4 programming forum - Page 3 #25
    3. The charts show Bid prices only. Turn on the Ask line to see how big the spread is (Tools → Options (Control-O) → charts → Show ask line.)

Reason: