Skip to content

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

FeatureLagPurpose
price_lag_1h1 hourMost recent known price
price_lag_2h2 hoursShort-term trajectory
price_lag_3h3 hoursShort-term trajectory

Historical Same-Period Lags

FeatureLagPurpose
price_lag_24h24 hoursSame hour yesterday
price_lag_48h48 hoursSame hour 2 days ago
price_lag_72h72 hoursSame hour 3 days ago
price_lag_168h168 hoursSame 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

FeatureWindowPurpose
price_rolling_6h6 hoursVery recent trend
price_rolling_24h24 hoursDaily average price level
price_rolling_168h168 hoursWeekly average price level

Volatility Measures

FeatureWindowPurpose
price_std_24h24 hoursDaily price volatility
price_std_168h168 hoursWeekly price volatility
price_min_24h24 hoursDaily price floor
price_max_24h24 hoursDaily price ceiling
price_range_24h24 hoursDaily 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.

FeatureComputationPurpose
price_change_1hprice(t-1) - price(t-2)Recent direction
price_change_24hprice(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 hour
  • price_lag_24h = price at origin - 24 hours
  • price_lag_168h = price at origin - 168 hours

Target-Hour Historical References

FeatureDescription
target_hour_price_yesterdayPrice at the same hour-of-day as the target, 24h before the origin
target_hour_price_last_weekPrice 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:

FeatureDescription
d1_mean_priceD+1 daily average price
d1_min_priceD+1 minimum price
d1_max_priceD+1 maximum price
d1_std_priceD+1 price standard deviation
d1_peak_spreadD+1 peak (hours 8–21) vs off-peak mean spread
d1_same_hour_priceD+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.