开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Simplest Way to know if Individual Candle Data is Pre-market, Market or After-hours.


 

if I request Market data with `outsideRth=true`, I get the data for the whole pre-market, market, and after-hours market hours which is great.
?
However, when I inspect each candle in the data, I get the candle's time (t) but, at this point I have no way of knowing whether that one candle sits in pre-market, market or after-hours market hour.
?
So my question is, what would be the simplest way to establish whether a single candle sits in pre-market, market or after-hours market hour?
?
Is executing date/time calculations for each candle's time (t) the only way of doing this? This could be quite complex as would need to take into account different time zones, time of year (daylight savings time), etc. when carrying out each calculation.
?
One option in my head is to request the market data twice; once with `outsideRth=true` and a second time with `outsideRth=false` where I would then take the difference between one set and the other which would leave me with the outsideRth candles separated from the RTH candles but, the outsideRth candles would still include both pre-market and after-hours candles and therefore, I would still need to make calculations for each candle to know exactly which period any one candle belongs in (e.g. pre-market, market, after-hours).
?
Thanks in advance for any answers to this question.
?
PS: This is my first time posting here and I have tried searching to see if this has been asked before but I did not get any results back so, apologies if I am not using the search tool properly or not posting the question properly either.

Join [email protected] to automatically receive all group messages.