I can't find a definitive answer for this:

When generating (compressed) OHLC records from tick data, which field do I use for the Open and Close?

Highest Ask for timeframe High makes sense; Lowest Bid for timeframe Low makes sense;

But Tick data just has Bid and Ask, not High or Low. It's not possible to know if any given trade was at the Bid or Ask.

So how do I determine which one to use for Open (first tick) and Close (last tick) for each timeframe?



There is no definitive answer to this but I believe most recording systems measure the open and close as the first and last traded price, respectively, irrespective of the bid and ask.

If you only have bid and ask prices and not a list of traded prices then you cannot ascertain this information, and I would be inclined to model it systematically as the unweighted average, with some mechanism for dealing with prices at open or close that are missing bids or offers.

Incidentally, I disagree with your 'sense' statements. I would use the highest bid as the high and the lowest offer as the low, for the reason that this is robustly stable and also corresponds to a sensible executable level. In an illiquid market where there is no ask price I might offer to sell a single share in 'Complete Dog Plc.' for a bazillion dollars, and for that period of time it would be the best (and highest) ask price of the day, but completely useless for analysis. On the other hand I suspect no one would ever bid higher that some competitive price, e.g $0.01, for 'Complete Dog Plc.' and therein lies your robustness.

  • $\begingroup$ Thank you so much. I should have been clearer - it is forex tick data, which appears to list a bid-ask spread for every tick. But I see your point about the bid being a more realistic (and robust) measure...I get the feeling the bid is what other people/tools use. $\endgroup$ – skeetastax Aug 13 '18 at 22:48
  • $\begingroup$ I suppose the issue I was getting at is that I don't 'know' which, out of the bid and the ask listed for each tick, was "the last traded price"...if I knew, then I would have my answer... $\endgroup$ – skeetastax Aug 13 '18 at 22:54

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.