Encoding Hour-of-Day Features as Indicator Buffers for Trading Models
Summary
This document explains an indicator that converts each bar’s timestamp into hour-of-day features for data collection and modeling. It provides 24 binary buffers, one for each hour, and an additional buffer containing the numeric hour. For each bar, the program calculates the hour from the timestamp, clears the binary values, then sets the matching hour’s value to one. The indicator exposes these values in the data window so they can be copied alongside other indicator data into a dataset, including for machine-learning work.
The discussion also covers buffer declarations, labels, recalculation from the previous bar, and a text comment used as a debugging display. It is a data-preparation utility rather than a trading signal or strategy, and it reports no predictive test or performance evidence. Its usefulness depends on consistent timestamp conventions: the hour feature reflects the time basis of the platform’s bar timestamps, so users should align that basis with their market data and modeling objective.
Key ideas
- The indicator represents each bar’s hour with one active value among 24 binary features.
- A separate buffer records the hour as a number from 0 through 23.
- These features can be copied into a dataset alongside other indicator values for modeling.
- The timestamp convention determines the meaning of the extracted hour, and the document gives no evidence of predictive performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.