1

I can get bid and ask data from my market data provider but I want to convert this in OHLC values. What is the good calculation using bid/ask? I saw in a post that for a specific period:

Open = (first bid + first ask) / 2.
High = Highest bid
Low = Lower ask
Close = (last bid + last ask) / 2 

Is it true?

Teddol
  • 17
  • 2
  • You can't calculate OHLC from bids and asks. Bids and Asks are limit orders for trades that haven't been filled yet, while OHLC bars show actual trades that have occurred on the market. And I think you have them backwards too. A bid is low and an ask is high. Let's say a price is at $950 and rising, so I decide that I'm going to ride that and buy when it hits $1000 and sell when it hits $1050. I put in a bid at $1000 and an ask at $1050. Those orders may never get filled. The price my go up to $999 (the high) and then drop. My bid and ask didn't affect the OHLC at all. – Jroonk Sep 29 '22 at 05:48

2 Answers2

1

You are getting confused with terminology. In forex:

Ask is the price that you, the trader, can currently buy at.

Bid is the price that you, the trader, can currently sell at.

OHLC are historical prices for a predetermined period of time (common time periods at 1 min, 5 min, 15 min, 30 min, 1 hour, 4 hour, daily and weekly) and are usually used to plot candle stick charts (and tend to be based on the Bid price only).

Open - This is the bid price at the commencement of the time period.

High - This is the highest bid price that was quoted during the time period.

Low - This is the lowest bid price that was quoted during the time period

Close - This is the last bid price at the end of the time period.

PaulB
  • 1,262
  • 1
  • 6
  • 17
0

Conversion between the two is not always straightforward or even possible. What many beginners (including myself) stumble upon: Ohlc data represents trades that did actually happen. Bid and ask represent requests for trades that might never happen. Simplified example: Let's say investor A wants to sell 100 shares of a specific company for 20$ each, so he places ask(100,20) on the market. Investor B wants to buy 100 shares of the same company, but only wants to pay 18$ each, so he places bid(100,18). If both are not willing to change their price, no trade will happen and no ohlc data will be generated (if no other trades occur in this timeframe). Of course, one can assume that if trades happen in a specific time frame, h will be the highest price someone is willing to pay (highest bid) and l will be the lowest price someone is willing to sell for (lowest ask), as those orders have the highest chance of being met. But I think o and c values really depend on which bids/asks actually turned into a trade.

Max
  • 1