4

I have a stream of bid/ask market data and a stream of executed trades.

Quick question, as not too sure how to best approach this. To draw an OHLC chart, would I:

a) Base calculation entirely on observed bid prices over a time period (highest bid, lowest bid, and last bid during that period)

b) Base calculation entirely on observed ask prices over a time period

c) Base the OHLC chart on executed trades at price x doing the time period?

I have also seen someone on a metatrader forum mention off the cuff that:

Open: (bid + ask) / 2

High: highest bid

Low: lowest offer

Close: (bid + ask) / 2

So wondering which of all these it is?

Best regards,

5

The Open - is the first traded price for the period.

The High - is the highest traded price for the period.

The Low - is the lowest traded price for the period.

The Close - is the last traded price for the period.

Any existing Bid/Ask prices remaining in the market depth have not been traded yet so can not be used to produce charts. So point (c) is your answer.

  • Also, in corner cases (no trades during the period) the open and close would just be the last candle's close price, high would be highest bid, low would be lowest offer during the period; at least that's what CME does with its daily futures summary – hroptatyr Nov 22 '13 at 7:39
  • @hroptatyr - usually most charts are represented by a single dash at the previous close price if there is no trade during a period. – Victor Nov 22 '13 at 20:41
  • so when they show a single value of price, are they taking the average, mean or some other measure to represent a single value – PirateApp Mar 27 '18 at 6:46
  • 1
    @PirateApp - a single value line chart is by default the last traded price for that period, however, some charting packages do allow you to change the default last price to one of the others (high, low or open). – Victor Mar 27 '18 at 9:35
  • 1
    @PirateApp - you don't calculate any price, you just use the actual traded prices. Most charting packages will provide the traded prices or you can usually download it from various sources. – Victor Mar 27 '18 at 11:31
1

I would think it would be based on executed trades. Otherwise there would be lows of $0.01 for most stocks from someone putting in ridiculously low, unrealistic offers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.