Price Dynamics
Price dynamics features capture recent market behavior — trends, volatility, and historical patterns at the same hour. These are among the most important predictive signals, with yesterday’s same-hour price often ranking as a top feature.
Price Lags
Lagged prices provide the model with direct information about recent market levels. All lags are shifted by 1 hour to prevent data leakage (the current hour’s price is not known at prediction time).
Short-Term Lags
| Feature | Lag | Purpose |
|---|---|---|
price_lag_1h | 1 hour | Most recent known price |
price_lag_2h | 2 hours | Short-term trajectory |
price_lag_3h | 3 hours | Short-term trajectory |
Historical Same-Period Lags
| Feature | Lag | Purpose |
|---|---|---|
price_lag_24h | 24 hours | Same hour yesterday |
price_lag_48h | 48 hours | Same hour 2 days ago |
price_lag_72h | 72 hours | Same hour 3 days ago |
price_lag_168h | 168 hours | Same hour last week |
The 168-hour (1-week) lag captures weekly periodicity — Monday 10:00 tends to resemble last Monday 10:00. This is also the warmup boundary: the first 168 hours of any dataset are discarded because this lag is unavailable.
Rolling Statistics
Rolling windows provide smoothed trend and volatility signals.
Rolling Means
| Feature | Window | Purpose |
|---|---|---|
price_rolling_6h | 6 hours | Very recent trend |
price_rolling_24h | 24 hours | Daily average price level |
price_rolling_168h | 168 hours | Weekly average price level |
Volatility Measures
| Feature | Window | Purpose |
|---|---|---|
price_std_24h | 24 hours | Daily price volatility |
price_std_168h | 168 hours | Weekly price volatility |
price_min_24h | 24 hours | Daily price floor |
price_max_24h | 24 hours | Daily price ceiling |
price_range_24h | 24 hours | Daily price spread (max - min) |
High volatility often precedes continued volatility. A wide 24-hour range indicates an active market that may continue to swing.
Momentum Indicators
Price changes capture the direction and speed of market movements.
| Feature | Computation | Purpose |
|---|---|---|
price_change_1h | price(t-1) - price(t-2) | Recent direction |
price_change_24h | price(t-1) - price(t-25) | Day-over-day change |
Positive momentum suggests prices are rising; negative suggests a declining market. Combined with other features, momentum helps the model distinguish between a market that’s trending up vs. one that’s mean-reverting.
Direct Prediction Variants
In the direct prediction framework, price dynamics features take a different form because all values must be known at the forecast origin (time t).
Origin-Based Lags
Instead of lags relative to each target hour, all lags reference the origin:
price_lag_1h= price at origin - 1 hourprice_lag_24h= price at origin - 24 hoursprice_lag_168h= price at origin - 168 hours
Target-Hour Historical References
| Feature | Description |
|---|---|
target_hour_price_yesterday | Price at the same hour-of-day as the target, 24h before the origin |
target_hour_price_last_week | Price at the same hour-of-day as the target, 168h before the origin |
These give the model a “what usually happens at this time” anchor specific to each prediction target.
D+1 Price Features (Strategic Only)
When D+1 prices are known (afternoon strategic run), additional features are extracted:
| Feature | Description |
|---|---|
d1_mean_price | D+1 daily average price |
d1_min_price | D+1 minimum price |
d1_max_price | D+1 maximum price |
d1_std_price | D+1 price standard deviation |
d1_peak_spread | D+1 peak (hours 8–21) vs off-peak mean spread |
d1_same_hour_price | D+1 price at the same hour-of-day as the target |
d1_same_hour_price is the single most important feature in the strategic model, accounting for approximately 26.5% of total feature importance. Tomorrow’s 14:00 price is highly predictive of the day-after-tomorrow’s 14:00 price.