BID, ASK and LAST price. Which to use best for different siutations

 

Hi to everybody. I am new to MQL5 and trading.

There are two things I am not quite sure if understood correctly:

  1. Is it correct for stocks to buy at the ask price and sell at the bid price? I trade via NASDAQ stock exchange. I found different sites on the web but it is sometimes confusing and I am not entirely sure if I got it right
  2. I try to detect trends and also have a definition when a trend is broken. I have often read that the candlesticks in the chart are only based on the bid price. My broker confirmed this as well. Since candlesticks are based on bid price, should I best use the bid price to check if a trend is broken? I also thought about the last price. I understood that as soon as a transaction (buy or sell) is completed a new last price is given 
  3. If I have a long position open with a defined virtual stop loss. Do I use the bid price to check whether the stop loss has been reached since we sell at bid price and candlesticks are also based on it? Or is it better to use last price here?
  4. At which situations in your trading do you use the last price?

Sorry, if this sounds to basic for you but at least for me as more or less a beginner it is somehow a bit confusing.

Thank you,

Jens

 
ammer.jens:

Hi to everybody. I am new to MQL5 and trading.

There are two things I am not quite sure if understood correctly:

  1. Is it correct for stocks to buy at the ask price and sell at the bid price? I trade via NASDAQ stock exchange. I found different sites on the web but it is sometimes confusing and I am not entirely sure if I got it right
  2. I try to detect trends and also have a definition when a trend is broken. I have often read that the candlesticks in the chart are only based on the bid price. My broker confirmed this as well. Since candlesticks are based on bid price, should I best use the bid price to check if a trend is broken? I also thought about the last price. I understood that as soon as a transaction (buy or sell) is completed a new last price is given 
  3. If I have a long position open with a defined virtual stop loss. Do I use the bid price to check whether the stop loss has been reached since we sell at bid price and candlesticks are also based on it? Or is it better to use last price here?
  4. At which situations in your trading do you use the last price?

Sorry, if this sounds to basic for you but at least for me as more or less a beginner it is somehow a bit confusing.

Thank you,

Jens

1. Of course a buy is always at ask and a sell at bid, by definition.

2. If you really trade on a stock exchange the chart is using the last price, not the bid.

3. For stock exchange, the last price trigger the stop loss when is then executed at either bid or ask depending of the direction.

4. You can't choose, it's how it works.

 

Hello Alain,


I checked with my broker again and you were right. For stock exchanges it is the last prices NOT the bid price. I confused this with CFDs.

So, I changed my code to check on the last price whether virtual stop loss has been reached or not and if so I sell using the bid price. I think that should be the right way now...


I have one more question:

I have a long position open (stock exchange again) with the stop loss lying at the market (so no virtual stop loss). If I use a trailing stop loss and want to update the stop loss via the PositionModify() function, do I do this using the last price or the bid price?


Thank you, Jens

 
ammer.jens:

Hello Alain,


I checked with my broker again and you were right. For stock exchanges it is the last prices NOT the bid price. I confused this with CFDs.

So, I changed my code to check on the last price whether virtual stop loss has been reached or not and if so I sell using the bid price. I think that should be the right way now...


I have one more question:

I have a long position open (stock exchange again) with the stop loss lying at the market (so no virtual stop loss). If I use a trailing stop loss and want to update the stop loss via the PositionModify() function, do I do this using the last price or the bid price?


Thank you, Jens

You do it using any price you want which is allowed. Most probably neither the bid or the last price, as they are the current prices and you don't want (or can) to use that as stoploss.

The stoploss will be triggered by the last price.

Reason: