Skip to main content

Features

Features sit one layer above indicators. They usually combine, re-express, lag, or contextualize price and volume information into model-ready signals or regime flags.

Use this page when you need to choose between feature helpers, understand their input requirements, or see what each helper adds to a frame. For lower-level signal primitives, see Indicators.

Conventions

  • Feature helpers usually append columns and return the original frame with the extra outputs attached.
  • Some helpers operate on plain kline data only. Others require trade-derived columns such as maker_ratio, no_of_trades, price, or quantity.
  • Not every helper is intended as a final predictor. Some are utilities used to build targets or wider feature families.
  • Several regime helpers output compact categorical-style columns such as regime_ma_slope or regime_price_band.
  • A few helpers return scalar values instead of frames. The main example is find_min_d, which searches for a stationarity-preserving fractional-differentiation order.

Quick Example

from limen.data import HistoricalData
from limen.experiment import Manifest
from limen.features import kline_imbalance, vwap
from limen.indicators import atr, roc
from limen.sfd.reference_architecture import logreg_binary


def manifest():
return (
Manifest()
.set_data_source(
method=HistoricalData.get_spot_klines,
params={'kline_size': 3600, 'start_date_limit': '2025-01-01'},
)
.set_test_data_source(
method=HistoricalData.get_spot_klines,
params={'kline_size': 7200, 'row_count_limit': 5000},
)
.set_split_config(8, 1, 2)
.add_indicator(roc, period='roc_period')
.add_indicator(atr, period=14)
.add_feature(vwap)
.add_feature(kline_imbalance, window='imbalance_window')
.with_reference_architecture(logreg_binary)
)

Kline-Derived Position And Volatility Features

These helpers work directly on bar data and are usually the easiest feature layer to add to a first manifest.

FunctionAdds by defaultNotes
atr_percent_smaatr_percent_smaATR scaled by close price using SMA smoothing.
atr_smaatr_smaSMA-smoothed ATR variant.
close_positionclose_positionClose location inside the current bar's high-low range. Accepts window; 1 preserves single-bar behavior.
close_position_rollingclose_position_rollingRolling mean of close location inside the high-low range.
close_ma_distance_atrclose_ma_distance_atrClose-to-SMA distance normalized by SMA-smoothed true range.
distance_from_madistance_from_maClose distance from its rolling moving average.
distance_from_highdistance_from_highDistance from a rolling high.
distance_from_lowdistance_from_lowDistance from a rolling low.
gap_highgap_highCurrent high relative to the previous close.
kaufman_efficiency_ratiokaufman_efficiency_ratioDirectional displacement divided by the rolling path length.
narrow_rangenarrow_rangeCurrent range divided by trailing maximum range.
price_range_positionprice_range_positionRolling range position over a wider window.
range_pctrange_pctCurrent bar range as a percentage.
stochastic_k_absstochastic_k_absAbsolute distance between stochastic %K and 0.5.
trend_strengthtrend_strengthFast-versus-slow trend strength summary.
volume_to_rangevolume_to_rangeRolling mean volume per unit of high-low range.
volume_regimevolume_regimeVolume context over a lookback window.
vwapvwapRequires a datetime-like datetime column because VWAP resets by trading day.
wick_proportionwick_proportionRolling mean wick share of full candle range.

Calendar And Cyclical Time Features

These helpers derive time-of-bar context from datetime without depending on earlier indicator columns.

FunctionAdds by defaultNotes
calendar_time_featureshour, minute, weekday, day_of_month, day_of_year, week_of_year, month, quarter, half_of_year, is_weekendAdds discrete calendar fields for downstream splits, filters, and rules. weekday uses ISO numbering (Monday=1 to Sunday=7), and week_of_year uses ISO week numbering.
cyclical_time_featureshour_sin, hour_cos, minute_sin, minute_cos, weekday_sin, weekday_cos, day_of_month_sin, day_of_month_cos, day_of_year_sin, day_of_year_cos, week_of_year_sin, week_of_year_cos, month_sin, month_cos, quarter_sin, quarter_cosEncodes cyclical calendar fields without introducing artificial ordinal jumps. Uses the same ISO conventions as calendar_time_features; weekday cycles are phase-aligned with weekday - 1 before applying sine/cosine.
is_funding_houris_funding_hourParameterized funding-cadence hour indicator; default hours are 0, 8, and 16.
is_us_open_houris_us_open_hourParameterized US open-hour indicator; default hour is 14.

Range-Based Volatility Features

These helpers estimate volatility directly from OHLC structure instead of relying only on close-to-close returns.

FunctionAdds by defaultNotes
parkinson_volatilityparkinson_volatilityHigh-low range estimator that ignores close-to-close drift.
parkinson_vol_of_volparkinson_vol_of_volRolling standard deviation of Parkinson variance.
garman_klass_volatilitygarman_klass_volatilityOHLC estimator using open, high, low, and close information.
rogers_satchell_volatilityrogers_satchell_volatilityDrift-robust OHLC volatility estimator.
volatility_ratiovolatility_ratioShort rolling Parkinson variance divided by long rolling Parkinson variance.
volatility_spikevolatility_spikeCurrent Parkinson variance divided by its fixed-lag value.
yang_zhang_volatilityyang_zhang_volatilityCombines overnight, open-close, and range information into a higher-fidelity volatility estimate. Requires window > 1.

Liquidity And Impact Features

These helpers translate ordinary OHLCV bars into simple liquidity, impact, and slippage proxies.

FunctionAdds by defaultNotes
dollar_volumedollar_volumePrice-times-volume activity proxy using close and volume.
amihud_illiquidityamihud_illiquidityAbsolute return per dollar of volume, a compact price-impact proxy.
return_per_dollar_volumereturn_per_dollar_volumeSigned return per dollar of volume, useful when direction matters as much as impact.
range_per_dollar_volumerange_per_dollar_volumeBar range scaled by dollar volume.
illiquidity_shockilliquidity_shockCurrent Amihud-style illiquidity relative to its own trailing mean.
liquidity_dropliquidity_dropCurrent LOB liquidity divided by fixed-lag LOB liquidity.
liquidity_rangeliquidity_rangeRolling mean high-liquidity to low-liquidity ratio.
maker_liquidity_sharemaker_liquidity_shareMaker liquidity divided by total liquidity.
maker_volume_sharemaker_volume_shareMaker volume divided by total volume.
maker_volume_ratiomaker_volume_ratioRolling mean maker-volume share.
taker_imbalance_ratiotaker_imbalance_ratioRolling mean absolute taker imbalance as a share of volume.
trade_densitytrade_densityRolling mean number of trades per unit of volume.
trade_imbalancetrade_imbalanceRolling maker volume divided by rolling total volume.
trade_size_ratiotrade_size_ratioShort average trade size divided by long average trade size.

Realized Risk And Tail Features

These helpers describe the quality of recent movement, not just its level.

FunctionAdds by defaultNotes
realized_semivarianceupside_semivariance, downside_semivarianceSplits rolling squared returns into upside and downside components.
downside_volatility_ratiodownside_volatility_ratioRolling downside squared-return share of total squared returns.
realized_skewnessrealized_skewnessRolling skewness of close-to-close returns.
realized_kurtosisrealized_kurtosisRolling kurtosis of close-to-close returns.
jump_variation_proxyjump_variation_proxyPositive gap between realized variance and bipower variation proxy.
tail_event_intensitytail_event_intensityShare of recent bars whose absolute return exceeds a configurable threshold.
volatility_of_volatilityvolatility_of_volatilityRolling variability of rolling close-to-close return volatility.
return_autocorrelationreturn_autocorrelationRolling correlation between returns and one-bar lagged returns.
return_volatility_correlationreturn_volatility_correlationRolling correlation between returns and Parkinson variance.
volume_volatility_correlationvolume_volatility_correlationRolling correlation between volume and Parkinson variance.

Seasonality-Normalized Features

These helpers compare current bar behavior to the trailing mean for the same hour of the week.

FunctionAdds by defaultNotes
relative_volume_seasonalityrelative_volume_seasonalityCurrent volume relative to the trailing baseline for the same hour-of-week bucket.
relative_range_seasonalityrelative_range_seasonalityCurrent range percentage relative to the trailing hour-of-week baseline.
relative_volatility_seasonalityrelative_volatility_seasonalityCurrent absolute return magnitude relative to the trailing hour-of-week baseline.

Candle Structure And Auction Features

These helpers focus on how a bar moved internally, not just where it finished.

FunctionAdds by defaultNotes
body_to_rangebody_to_rangeAbsolute candle body size divided by the full bar range.
wick_imbalancewick_imbalanceUpper-wick minus lower-wick imbalance as a share of full range.
range_overlaprange_overlapOverlap share between the current bar range and the previous bar range.
rejection_intensityrejection_intensityWick-heavy rejection proxy based on total wick share and directional close location.
absorption_intensityabsorption_intensityHigh-volume, small-body absorption proxy using a trailing shifted volume baseline.

Cross-Timescale Context Features

These helpers summarize whether multiple horizons agree or disagree about market state.

FunctionAdds by defaultNotes
trend_coherencetrend_coherenceAverage sign agreement across short, medium, and long return horizons.
volatility_term_structurevolatility_term_structureAverage ratio between short, medium, and long rolling volatility estimates.

Breakout And Regime Features

These helpers are useful when you want state or structure, not just a continuous numeric series.

FunctionAdds by defaultNotes
breakout_featuresmany lagged breakout columns plus long_roll_mean, long_roll_std, short_roll_mean, short_roll_std, roc_long_12_1, roc_short_12_1Designed to enrich pre-existing breakout flags.
breakout_percentile_regimeprice_range_position, regime_breakout_pctUses percentile thresholds over price-range position.
hh_hl_structure_regimeregime_hh_hlCaptures higher-high and higher-low style structure.
ichimoku_cloudtenkan, kijun, senkou_a, senkou_b, chikouFull Ichimoku feature set.
ma_slope_regimeregime_ma_slopeRegime label based on moving-average slope.
price_vs_band_regimeregime_price_bandUses price distance relative to a band definition.
sma_crossovercrossover, signalCompact crossover-state helper.
window_return_regimeret_24, regime_window_returnReturn plus regime thresholding over a window.

Lag Helpers And Threshold Utilities

These helpers are mainly used to expand existing columns or define cutoffs for target construction.

FunctionAdds or returnsNotes
lag_columnone lagged column such as close_lag_2Requires col and lag.
lag_columnsone lag per listed columnRequires cols and lag.
lag_rangea lag range such as close_lag_1 through close_lag_3Requires col, start, and end.
lag_range_colsa lag range for each listed columnRequires cols, start, and end.
rolling_zscoreconfigurable *_zscore_* columnApplies identity, log1p, or abs before rolling z-score standardization.

Stationarity And Long-Memory Helpers

These helpers are useful when you want to reduce non-stationarity while preserving more long-memory structure than a simple first difference would.

FunctionAdds or returnsNotes
fractional_diffone *_fracdiff column per selected input columnApplies fixed-width fractional differentiation. Original columns are preserved.
find_min_dscalar d valueIterates over candidate orders and uses the Augmented Dickey-Fuller test to find the smallest stationary order.

Two practical details matter:

  • fractional_diff needs cols=[...] and writes new columns such as close_fracdiff.
  • if one split is too short to produce the same fractional-diff column as another split, Manifest now drops that extra column during split alignment so the final data_dict stays consistent.

Trade-Shape And Microstructure Features

These helpers need richer data than ordinary OHLCV bars.

FunctionAdds by defaultNotes
kline_imbalanceimbalanceRequires maker_ratio and no_of_trades. Useful when those were carried through data retrieval or bar formation.
conserved_flux_renormalizationsynthetic OHLCV plus value_sum, vwap, flux_rel_std_mean, flux_rel_std_var, entropy_mean, entropy_var, Δflux_rms, Δentropy_rmsWorks on trade-level datetime, price, and quantity, then rolls those into kline-aligned diagnostics.

Choosing Between Indicators And Features

  • Use an indicator when you want a direct market calculation such as RSI, ATR, or MACD.
  • Use a feature when you want structure around those signals, such as lags, regimes, relative position, or multi-step aggregation.
  • Use the lag helpers when the main value is temporal context rather than a new market calculation.
  • Use fractional_diff when stationarity itself is part of the design problem, not just a preprocessing afterthought.
  • Indicators for lower-level signal primitives
  • Transforms for target shaping and post-model calibration helpers
  • Experiment Manifest for how features plug into the split-first manifest pipeline
  • Utilities for the exported adf_test() helper that find_min_d builds on