Kopie Quant LLC, Austin TX

Supported Libraries

These vectorized primitives, standard libraries, and dependency structures map natively to the Python Sidecar execution grids. You can safely invoke them implicitly inside your isolated feature sandboxes.

Python Utilities

Core & Numerical

numpy

Foundational N-dimensional array library for fast numerical computation.

BSD-3-Clause
scipy

Scientific computing primitives — optimization, stats, linear algebra.

BSD-3-Clause
numba

JIT compilation for Python/NumPy code targeting CPU and GPU via LLVM.

BSD-2-Clause
numexpr

Fast element-wise numerical evaluation, bypasses NumPy's Python overhead.

MIT
Python
import numpy as np
import scipy.stats as stats
import numba
from numexpr import evaluate

Data Wrangling

pandas

DataFrame library for relational and time-series data manipulation.

BSD-3-Clause
polars

High-performance DataFrame engine built on Apache Arrow and Rust.

MIT
Python
import pandas as pd
import polars as pl
# Load OHLCV from parquet (Polars preferred)
df = pl.read_parquet("aapl.parquet")

Technical Indicators

TA-Lib

C-backed technical analysis library — 150+ indicators including RSI, MACD, Bollinger.

BSD-2-Clause
pandas-ta

Pandas-native indicator extension with 130+ indicators using a fluent API.

MIT
finta

Common financial technical indicators implemented in pure Pandas.

LGPL-3.0
tulipy

Python bindings for Tulip Indicators — fast C-based technical library.

LGPL-3.0
Python
import talib
import pandas_ta as ta
import finta
# Example: 14-period RSI via TA-Lib
rsi = talib.RSI(close, timeperiod=14)
# Example: pandas_ta integration
df.ta.macd(fast=12, slow=26, signal=9, append=True)

Machine Learning & Statistics

scikit-learn

Classic ML library — classification, regression, clustering, preprocessing.

BSD-3-Clause
statsmodels

Econometric & statistical modeling — ARIMA, OLS, cointegration tests.

BSD-3-Clause
arch

GARCH/EGARCH volatility modeling and financial econometrics.

MIT
PyTorch

Dynamic deep learning framework with first-class GPU and autograd support.

BSD-3-Clause
TensorFlow / Keras

End-to-end ML platform for building, training, and deploying neural networks.

Apache-2.0
xgboost

Gradient boosted trees — state of the art for tabular signal classification.

Apache-2.0
lightgbm

Memory-efficient gradient boosting framework from Microsoft Research.

MIT
cvxpy

Domain-specific language for convex optimization and portfolio construction.

Apache-2.0
Python
from sklearn.ensemble import RandomForestClassifier
from statsmodels.tsa.stattools import adfuller
import torch
import xgboost as xgb
import cvxpy as cp
# Convex portfolio optimization
w = cp.Variable(n)
prob = cp.Problem(cp.Maximize(mu @ w), [cp.sum(w) == 1, w >= 0])
prob.solve()

Risk & Performance Analytics

pyfolio

Portfolio and risk analytics — tear sheets, rolling Sharpe, drawdown.

Apache-2.0
empyrical

Core financial risk metrics: Sharpe, Sortino, Calmar, max drawdown.

Apache-2.0
quantstats

Portfolio analytics and HTML report generation from a returns series.

Apache-2.0
riskfolio-lib

Advanced portfolio optimization — HRP, CVaR, hierarchical risk parity.

BSD-3-Clause
Python
import quantstats as qs
import pyfolio as pf
import empyrical as emp
# Compute Sharpe ratio and max drawdown
sharpe = emp.sharpe_ratio(returns)
mdd = emp.max_drawdown(returns)
# Full tear sheet
pf.create_full_tear_sheet(returns, benchmark_rets=benchmark)

Visualization & Export

plotly

Interactive charting library — candlesticks, 3D plots, dashboards.

MIT
plotly-kaleido

Static SVG/PNG export engine for Plotly charts without a browser.

MIT
matplotlib

The de-facto Python 2D plotting library — line charts, histograms, heatmaps.

PSF
seaborn

Statistical data visualization built on Matplotlib with a cleaner API.

BSD-3-Clause
Python
import plotly.express as px
import plotly.graph_objects as go
import matplotlib.pyplot as plt
import seaborn as sns
# Interactive candlestick
fig = go.Figure(data=[go.Candlestick(
x=df['date'], open=df['open'],
high=df['high'], low=df['low'], close=df['close']
)])
fig.show()

Utilities

joblib

Lightweight parallel loop execution and memoization for Python functions.

BSD-3-Clause
tqdm

Fast, extensible progress bars for loops and async pipelines.

MIT/MPL
Python
from joblib import Parallel, delayed
from tqdm import tqdm
import numexpr as ne
# Parallel strategy evaluation
results = Parallel(n_jobs=-1)(
delayed(run_backtest)(params)
for params in tqdm(param_grid)
)

C# Utilities

C# Analytics & Machine Learning

Math.NET Numerics

Methods and algorithms for numerical computations in science and engineering.

MIT
ML.NET

Cross-platform open-source machine learning framework from Microsoft.

MIT
Accord.NET

Machine learning framework combining audio and image processing libraries.

LGPL-2.1
C#
using MathNet.Numerics.Statistics;
using Microsoft.ML;
using Accord.MachineLearning;
// Train a robust regression model
var mlContext = new MLContext();
var model = mlContext.Regression.Trainers.FastTree();

C# Data Wrangling & Time

Deedle

Data frame and series library for data manipulation and scientific programming.

BSD-2-Clause
NodaTime

Advanced date and time API for high precision financial timezone handling.

Apache-2.0
C#
using Deedle;
using NodaTime;
// Initialize frame mapped for timeseries
var frame = Frame.ReadCsv("data.csv");
var ts = frame.IndexRows<DateTime>("Date");
var windowed = ts.Window(5);

C# Technical Indicators

TA-Lib.NET

C# wrapper to rapidly execute the original native C TA-Lib codebase.

BSD-2-Clause
C#
using TicTacTec.TA.Library;
// Direct C-engine TA-Lib execution
int outBegIdx, outNbElement;
double[] outReal = new double[size];
Core.Rsi(0, size - 1, input, 14,
out outBegIdx, out outNbElement, outReal);

C# Utilities

Newtonsoft.Json

High-performance JSON framework with advanced LINQ routing.

MIT
RestSharp

Simple, scalable REST and HTTP API client implementation.

Apache-2.0
C#
using Newtonsoft.Json;
using RestSharp;
// Fast API execution
var client = new RestClient("https://api.kopiequant.com");
var request = new RestRequest("v1/signal");
var response = await client.GetAsync(request);

Kopie Quant Library

Overview

This documentation is the canonical reference for every computation within the Kopie Quant data engineering ecosystem. Each Signal and Feature listed below represents a production-grade mathematical equation — verified against academic whitepapers and executed at scale by the Victory Engine, Kopie Quant's high-performance Rust computation layer. What you see here is the actual code behind each indicator: the precise formulas, kernel implementations, and parameter defaults that power every backtest, live signal, and forensic diagnostic within the platform.

Beyond the pre-built library, Kopie Quant provides a full Custom Logic SDK for building your own proprietary scripts. The SDK defines 9 computational paradigms — from single-asset price analysis to cross-asset benchmarking and multi-timeframe alignment. To accelerate development, the platform includes a Signal Scaffold system that generates ready-to-use boilerplate code for any signal in the ecosystem. Import a signal's scaffold into your custom script and immediately access its full parameter surface, letting you compose institutional-grade strategies without writing infrastructure code.

Signals and Features are handled differently by the engineering layer. Signals are composable — you can pull their boilerplate into your custom scripts, modify thresholds, and combine them freely. Features operate at the infrastructure level. They are pre-computed by the Victory Engine's data pipeline and injected into your script environment automatically via the Universe Loader. You reference features by name and may adjust their parameters, but their computation is managed entirely by the engine — ensuring consistent, high-performance execution across all assets and timeframes without burdening your script with heavy rolling-window math.

Kopie Quant SDK: Core & Universe

The Kopie Quant SDK defines 9 computational paradigms that control how your custom script receives data. You activate each paradigm by naming your function arguments with specific prefixes — the AST transpiler reads your def calculate() signature and automatically generates the correct UI controls, data routing, and timeframe alignment. No imports, no base classes, no configuration files.

Custom Signal (Core Logic)def calculate(data)

Single-Asset Computation

The foundational paradigm. Your def calculate(data) receives a single asset's OHLCV DataFrame — Open, High, Low, Close, Volume — synchronized to your active chart resolution. All vectorized math operates exclusively on this primary instrument. Build standard technical indicators, detect candlestick formations, apply rolling statistical transformations, or compute custom volatility measures. No external asset dependencies. No cross-timeframe routing. Pure single-instrument computation.

Paradigm 0
Python
def calculate(data):
close = data["close"]
return close.rolling(14).mean() > close

Cross-Sectional Universedef calculate(data, universe)

Full Universe Cross-Section

The universe argument injects the complete OHLCV data for every asset in your active universe as a single grouped DataFrame, keyed by ticker. Compute cross-sectional momentum rankings across an entire basket, scan for sector-level volume concentration, or derive regime filters by counting instruments trading above structural moving averages. Each row is temporally aligned to the primary chart resolution.

Paradigm 2
Python
def calculate(data, universe):
returns = universe.groupby("ticker")["close"].pct_change()
rank = returns.groupby(level=0).rank(pct=True)
return rank

Cross-Asset Benchmarking

Dual-Asset Data Syncdef calculate(data, benchmark_1)

Cross-Asset OHLCV Injection

The benchmark_1 argument injects the raw OHLCV DataFrame of a secondary asset alongside your primary instrument, temporally synchronized to the same bar resolution. Compute live price spreads for pairs arbitrage, derive relative strength ratios against a market index, or calculate rolling beta coefficients between correlated instruments. The benchmark asset is user-configurable at runtime via the UI control surface.

Paradigm 1
Python
def calculate(data, benchmark_1):
primary_vol = data["close"].pct_change().rolling(20).std()
bench_vol = benchmark_1["close"].pct_change().rolling(20).std()
return (primary_vol / bench_vol) > 1.0

Benchmark Indicator Targetdef calculate(data, benchmark_1_signal_metric)

Cross-Asset Indicator Routing

The benchmark_1_signal_metric argument injects a specific indicator output computed on a different asset. The routed signal is evaluated on the benchmark instrument independently and delivered as a pre-computed series. Build macro regime filters that block individual stock executions unless a market index MACD is bullish, or gate trades on correlated ETF momentum confirmation. The benchmark asset and target indicator are both user-configurable.

Paradigm 3.2
Python
def calculate(data, benchmark_1_signal_metric):
return data["close"] > benchmark_1_signal_metric["value"]

Multi-Timeframe Engine

Multi-Timeframe Assetdef calculate(data, mtf_1_data)

Multi-Timeframe OHLCV Injection

The mtf_1_data argument injects raw OHLCV price data from any asset on a different timeframe — typically a higher resolution (e.g., Daily bars while your primary chart operates on 5-minute intervals). The engine handles temporal alignment automatically, forward-filling higher-timeframe bars to match your primary resolution. Anchor intraday execution against Daily support and resistance levels, size positions using higher-timeframe ATR, or confirm macro trend direction before allowing micro entries.

Paradigm 1.5
Python
def calculate(data, mtf_1_data):
return data["close"] > mtf_1_data["high"]

Multi-Timeframe Indicator Targetdef calculate(data, mtf_signal_1_metric)

Multi-Timeframe Indicator Routing

The mtf_signal_1_metric argument injects a specific indicator output from any asset on a higher timeframe. The indicator is evaluated on the target instrument at the target resolution independently, then temporally aligned and delivered as a pre-computed series. Gate 5-minute entries on the Daily MACD direction of the broader market, or block trades when a correlated ETF's Daily Bollinger Bands signal overbought resistance. The target asset, timeframe, and indicator are all user-configurable.

Paradigm 3.5
Python
def calculate(data, mtf_signal_1_metric):
return mtf_signal_1_metric["value"] > 0

Indicator Composability

Indicator Metric Targetingdef calculate(data, signal_1_metric)

Single-Indicator Output Routing

The signal_1_metric argument injects a specific output line from any indicator already deployed in your workspace — e.g., the value line of an RSI, the histogram of a MACD. Build clean boolean threshold triggers, apply secondary smoothing to noisy oscillator outputs, or normalize unbounded indicator values into a standardized 0 to 100 percentage score. The target indicator and output line are user-configurable via the UI control surface.

Paradigm 3.1
Python
def calculate(data, signal_1_metric):
return signal_1_metric["value"] > 70

Multi-Indicator Combinerdef calculate(data, signal_1_matrix, signal_2_matrix)

Multi-Indicator Matrix Composition

The signal_1_matrix and signal_2_matrix arguments inject the full output matrices of multiple indicators simultaneously — every output line from each indicator is accessible. Build crossover detection systems, derive composite confidence scores by averaging across multiple indicator matrices, or implement divergence analysis comparing momentum structure against volume-based indicators. Each matrix argument maps to a user-selected indicator in your workspace.

Paradigm 3.3
Python
def calculate(data, signal_1_matrix, signal_2_matrix):
rsi_ok = signal_1_matrix["value"] < 30
macd_ok = signal_2_matrix["macd_line"] > 0
return rsi_ok & macd_ok

Multi-Indicator Metric Targetingdef calculate(data, signal_1_metric, signal_2_metric)

Multi-Indicator Precision Targeting

The signal_1_metric and signal_2_metric arguments inject specific output lines from multiple independent indicators simultaneously. Unlike the Matrix Combiner, this paradigm targets precise individual outputs rather than full matrices — enabling multi-variate boolean confluence logic. Fire execution signals only when RSI value is oversold AND MACD histogram is positive, or gate entries on simultaneous EMA crossover confirmation with ADX strength above a defined threshold.

Paradigm 3.4
Python
def calculate(data, signal_1_metric, signal_2_metric):
rsi_ok = signal_1_metric["value"] < 30
macd_ok = signal_2_metric["histogram"] > 0
result = rsi_ok & macd_ok
return result

Signals

Signals evaluate continuous market data into discrete binary or categorical triggers. They act as explicit threshold monitors, letting you define exactly when a structural condition or trading rule should activate.

Additional

signal.wcp

Weighted Close Price - Weighted close price (high + low + 2*close) / 4

signal.ohlc4

OHLC Average - Average of open, high, low, close

signal.psar_atr

Parabolic SAR with ATR - Parabolic SAR using ATR for acceleration

signal.cti

Correlation Trend Indicator - Spearman correlation with linear trend

signal.ebsw

Even Better Sinewave - Cycle indicator for identifying turning points

signal.inertia

Inertia - Trend smoothing using regression slope

signal.rvgi

Relative Vigor Index - Measures conviction of a recent price move

signal.qstick

QStick - Running average of open-close differences

signal.er

Efficiency Ratio - Kaufman's efficiency ratio measuring trend efficiency

signal.rsx

Relative Strength Xtra - Smoother version of RSI with less noise

signal.swma

Symmetrically Weighted Moving Average - 4-period weighted average - symmetrical triangle

signal.sinwma

Sine Weighted Moving Average - WMA with sine wave weighting

signal.ssf

Super Smoother Filter - Ehlers super smoother filter - minimal lag

signal.jma

Jurik Moving Average - Low lag moving average with adjustable smoothing

signal.mama

MESA Adaptive Moving Average - Ehlers MESA adaptive moving average

signal.pivots_hl

Pivot Points High/Low - Swing high and low pivot points

signal.td_sequential

TD Sequential - Tom DeMark sequential countdown indicator

signal.squeeze

TTM Squeeze - TTM Squeeze — detects volatility compression when Bollinger Bands move inside Keltner Channels, signaling impending breakout

signal.dv2

DV2 - DV2 — David Varadi mean-reversion oscillator combining close vs intraday range with smoothed percentile ranking

signal.midprice

Mid Price - Mid Price — average of the highest high and lowest low over a period

signal.midpoint

Mid Point - Mid Point — average of the highest and lowest close over a period

signal.typprice

Typical Price - Typical Price — (H+L+C)/3, same as hlc3

signal.wclprice

Weighted Close - Weighted Close Price — (H+L+2C)/4, emphasizes closing price

signal.avgprice

Average Price - Average Price — (O+H+L+C)/4

signal.medprice

Median Price - Median Price — (H+L)/2

signal.ht_avgprice

HT Average Price - Hilbert Transform Average Price — Hilbert-transformed mid price for cycle analysis

signal.minmax

Rolling Min/Max - Rolling Min/Max — highest and lowest values over a rolling window

signal.minmax_idx

Min/Max Index - Min/Max Index — bar index of the highest and lowest values within a rolling window

signal.sum

Rolling Sum - Rolling Sum — cumulative sum of source over a rolling window

signal.mma

Modified Moving Average - Modified Moving Average — also known as SMMA or Running Moving Average

signal.dema_rate

DEMA Rate of Change - DEMA Rate of Change — percentage rate of change of a Double EMA

signal.stdev_ma

Std Dev Moving Average - Standard Deviation Moving Average — moving average of the rolling standard deviation

signal.rolling_min

Rolling Minimum - Rolling Minimum — lowest value within a rolling window

signal.percent_change

Percent Change - Percent Change — percentage price change over a specified number of bars

signal.log_return

Log Return - Log Return — natural logarithm of price ratio, more statistically robust than simple returns

signal.cum_return

Cumulative Return - Cumulative Return — total percentage return from the start of the series

signal.drawdown

Drawdown - Drawdown — percentage decline from the running peak

signal.max_drawdown

Maximum Drawdown - Maximum Drawdown — worst peak-to-trough decline over a rolling window

Momentum

signal.rsi

Relative Strength Index - Measures speed and magnitude of price changes to evaluate overbought/oversold

signal.macd

Moving Average Convergence Divergence - Trend-following momentum indicator showing relationship between two EMAs

signal.stochrsi

Stochastic RSI - Applies stochastic formula to RSI values for more sensitivity

signal.cci

Commodity Channel Index - Measures current price relative to average price over a period

signal.cmo

Chande Momentum Oscillator - Measures momentum as difference between gains and losses

signal.mfi

Money Flow Index - Volume-weighted RSI measuring buying/selling pressure

signal.willr

Williams %R - Momentum indicator showing overbought/oversold levels

signal.roc

Rate of Change - Percentage change between current and past price

signal.mom

Momentum - Difference between current and past price

signal.trix

Triple Exponential Average - Rate of change of triple-smoothed EMA

signal.ppo

Percentage Price Oscillator - MACD expressed as percentage for cross-security comparison

signal.apo

Absolute Price Oscillator - Difference between two EMAs in absolute terms

signal.uo

Ultimate Oscillator - Weighted average of three oscillators with different timeframes

signal.tsi

True Strength Index - Double-smoothed momentum oscillator

signal.fisher

Fisher Transform - Transforms prices to Gaussian distribution for sharper signals

signal.ao

Awesome Oscillator - Bill Williams indicator comparing recent momentum to larger period

signal.ac

Accelerator Oscillator - Measures acceleration/deceleration of momentum

signal.bop

Balance of Power - Measures strength of buyers vs sellers

signal.kst

Know Sure Thing - Weighted sum of four rate of change indicators

signal.stochastic

Stochastic Oscillator - Stochastic Oscillator — measures closing price relative to high-low range, identifying overbought/oversold conditions

signal.dmi

Directional Movement Index - Directional Movement Index — measures trend strength and direction using +DI/-DI crossover with ADX confirmation

signal.aroonosc

Aroon Oscillator - Aroon Oscillator — difference between Aroon Up and Aroon Down, measuring trend strength from -100 to +100

signal.momersion

Momersion Indicator - Measures whether the market is in trending or mean-reverting mode using a ratio of up/down momentum bars

signal.roc_ratio

Rate of Change Ratio - Ratio of current price to price N bars ago, equivalent to 1 + ROC/100

Specialty

signal.squeeze_momentum

Squeeze Momentum Indicator - Combines Bollinger Band squeeze with momentum

signal.qqe

Quantitative Qualitative Estimation - Smoothed RSI with dynamic volatility bands

signal.vwmacd

Volume Weighted MACD - MACD using volume-weighted moving averages

signal.coppock

Coppock Curve - Long-term momentum indicator for major bottoms

signal.elder_ray

Elder Ray Index - Bull and bear power indicators

signal.wad

Williams Accumulation Distribution - Cumulative measure of buying/selling pressure

signal.dpo

Detrended Price Oscillator - Removes trend to identify cycles

signal.pmo

Price Momentum Oscillator - Double-smoothed rate of change

signal.schaff_trend

Schaff Trend Cycle - Combines MACD and stochastic for trend/cycle analysis

signal.connors_rsi

Connors RSI - Composite RSI using price, streak, and percentile

signal.smi

Stochastic Momentum Index - Shows where close is relative to midpoint of range

signal.psar_cloud

Parabolic SAR Cloud - Enhanced PSAR with trend cloud visualization

signal.chandelier_exit

Chandelier Exit - Trailing stop based on ATR from highs/lows

signal.ht_trendline

Hilbert Transform Trendline - Hilbert Transform Trendline — instantaneous trendline derived from the Hilbert Transform

signal.ht_sine

Hilbert Transform Sine Wave - Hilbert Transform Sine Wave — generates sine and lead sine from dominant cycle phase

signal.ht_trendmode

Hilbert Transform Trend Mode - Hilbert Transform Trend vs Cycle Mode — binary indicator distinguishing trending from cycling markets

signal.ht_dcperiod

Hilbert Transform Dominant Cycle Period - Hilbert Transform Dominant Cycle Period — instantaneous measurement of the dominant price cycle length

signal.ht_dcphase

Hilbert Transform Dominant Cycle Phase - Hilbert Transform Dominant Cycle Phase — instantaneous phase of the dominant cycle (0-360°)

signal.ht_phasor

Hilbert Transform Phasor - Hilbert Transform Phasor Components — in-phase and quadrature components of the analytic signal

signal.mesa_sine

MESA Sine Wave - MESA Sine Wave — John Ehlers MESA-derived sine/lead sine for early cycle turning point detection

signal.even_better_sine

Even Better Sine Wave - Even Better Sine Wave — Ehlers bandpass-filtered oscillator for cycle timing with reduced lag

signal.ehlers_roofing

Ehlers Roofing Filter - Ehlers Roofing Filter — bandpass filter combining high-pass and low-pass (SuperSmoother) for clean oscillator

signal.ehlers_super

Ehlers SuperSmoother - Ehlers SuperSmoother Filter — 2-pole Butterworth filter with zero lag at the cutoff frequency

signal.ehlers_decycler

Ehlers Decycler - Ehlers Decycler — removes cycle components to reveal the underlying trend

signal.reflex

Reflex Indicator - Reflex — Ehlers zero-lag trend indicator measuring normalized rate of change of the SuperSmoother

signal.trendflex

TrendFlex Indicator - TrendFlex — Ehlers trend measurement comparing SuperSmoother to its rolling mean

signal.cycle_period

Dominant Cycle Period - Dominant Cycle Period — adaptive measurement of the primary price oscillation period

signal.elder_force

Elder Force Index - Elder Force Index — measures the power behind every price movement using price change and volume

signal.gator

Gator Oscillator - Gator Oscillator — visualizes Alligator jaw/teeth/lips convergence and divergence as histogram bars

signal.alligator

Williams Alligator - Williams Alligator — three smoothed moving averages (Jaw, Teeth, Lips) identifying market phases

signal.fractals

Williams Fractals - Williams Fractals — identifies reversal points where a high/low is the extreme of 5 consecutive bars

signal.zigzag

ZigZag - ZigZag — connects significant highs and lows, filtering out moves smaller than a threshold percentage

signal.pivot_points

Pivot Points - Pivot Points — standard support/resistance levels calculated from prior period high, low, close

signal.vortex

Vortex Indicator - Vortex Indicator — captures positive and negative trend movements to identify trend direction and reversals

signal.mass_index

Mass Index - Mass Index — detects range expansions by tracking the narrowing and widening of the high-low range

signal.rwi

Random Walk Index - Random Walk Index — compares price movement to random walk theory to determine trend strength

signal.special_k

Special K - Special K — Martin Pring summed rate of change oscillator identifying primary market cycles

signal.didi_index

Didi Index - Didi Index — Brazilian indicator comparing short, medium, and long moving averages for trend signals

Statistic

signal.linreg

Linear Regression - Linear regression value at current bar

signal.linreg_slope

Linear Regression Slope - Slope of linear regression line

signal.linreg_intercept

Linear Regression Intercept - Y-intercept of linear regression line

signal.variance

Variance - Statistical variance of price

signal.skewness

Skewness - Measures asymmetry of distribution

signal.kurtosis

Kurtosis - Measures tail heaviness of distribution

signal.zscore

Z-Score - Number of standard deviations from mean

signal.median

Median - Middle value of price over period

signal.percentile

Percentile Rank - Percentage of values below current

signal.beta

Beta - Measures systematic risk relative to benchmark

signal.linreg_angle

Linear Regression Angle - Linear Regression Angle — angle (in degrees) of the linear regression line, indicating trend steepness

signal.rsquared

R-Squared - R-Squared — coefficient of determination measuring how well a linear regression fits the data (0-1)

signal.tsf

Time Series Forecast - Time Series Forecast — projects the linear regression one bar forward

signal.stderr

Standard Error - Standard Error of the Linear Regression — measures scatter around the regression line

signal.correl

Correlation Coefficient - Pearson Correlation Coefficient — measures linear relationship between source and a reference series

signal.mad

Mean Absolute Deviation - Mean Absolute Deviation — average absolute distance from the mean, a robust dispersion measure

signal.quantile

Rolling Quantile - Rolling Quantile — percentile value within a rolling window

signal.entropy

Shannon Entropy - Shannon Entropy — measures randomness/information content of the price distribution in a rolling window

signal.hurst

Hurst Exponent - Hurst Exponent — measures long-term memory of time series (H<0.5 = mean-reverting, H>0.5 = trending)

signal.covariance

Rolling Covariance - Rolling Covariance — measures how two series move together within a rolling window

signal.rolling_max

Rolling Maximum - Rolling Maximum — highest value within a rolling window

signal.rolling_sum

Rolling Sum - Cumulative sum of a price series over a rolling window, equivalent to LEAN's Sum indicator

signal.regression_channel

Regression Channel - Linear regression midline with upper and lower standard deviation bands, showing statistically significant price deviations

signal.swiss_army_knife

Swiss Army Knife - Digital signal processing filter bank — applies Gaussian, Butterworth, or SuperSmoother filters to price data for noise reduction

Trend Following

signal.sma

Simple Moving Average - Arithmetic mean of prices over a specified period

signal.ema

Exponential Moving Average - Weighted average giving more importance to recent prices

signal.wma

Weighted Moving Average - Linear weighted average with recent prices weighted higher

signal.dema

Double Exponential Moving Average - Reduces lag by applying EMA twice

signal.tema

Triple Exponential Moving Average - Further reduces lag with triple smoothing

signal.hma

Hull Moving Average - Reduces lag while maintaining smoothness using weighted averages

signal.vwma

Volume Weighted Moving Average - Average price weighted by volume

signal.kama

Kaufman Adaptive Moving Average - Adapts to market conditions using efficiency ratio

signal.zlema

Zero Lag Exponential Moving Average - EMA with reduced lag using de-lagging technique

signal.t3

Tillson T3 Moving Average - Smoother moving average with six EMAs and a volume factor

signal.supertrend

Supertrend - Trend-following indicator based on ATR

signal.ichimoku

Ichimoku Cloud - Comprehensive trend indicator showing support/resistance, momentum, and trend

signal.adx

Average Directional Index - Measures trend strength regardless of direction

signal.aroon

Aroon Indicator - Identifies trend changes and strength

signal.vidya

Variable Index Dynamic Average - Adaptive moving average using CMO as volatility index

signal.trima

Triangular Moving Average - Double-smoothed SMA for extra smoothness

signal.mcgd

McGinley Dynamic - Adaptive moving average that adjusts to market speed

signal.alma

Arnaud Legoux Moving Average - Gaussian weighted moving average with offset control

signal.frama

Fractal Adaptive Moving Average - Adapts to fractal dimension of price series

signal.smma

Smoothed MA - Smoothed Moving Average — recursive average where each bar contributes equally over the full lookback, reducing noise while maintaining trend fidelity

signal.lsma

Least Squares MA - Least Squares Moving Average — fits a linear regression line to the data within the lookback window and projects the endpoint

signal.psar

Parabolic SAR - Parabolic Stop and Reverse — trailing stop that accelerates toward price, flipping direction on penetration

Volatility

signal.atr

Average True Range - Measures market volatility using true range

signal.natr

Normalized Average True Range - ATR expressed as percentage of close price

signal.keltner

Keltner Channel - Volatility-based envelope using ATR

signal.donchian

Donchian Channel - Channel based on highest high and lowest low

signal.stddev

Standard Deviation - Statistical measure of price volatility

signal.atrp

Average True Range Percent - ATR as percentage of closing price

signal.ulcer

Ulcer Index - Measures downside volatility and drawdown risk

signal.rv

Realized Volatility - Sum of squared intraday returns annualized

signal.bbw

Bollinger Band Width - Width of Bollinger Bands as percentage

signal.percentb

Percent B - Price position within Bollinger Bands

signal.chop

Choppiness Index - Measures if market is choppy (sideways) or trending

signal.rvi

Relative Volatility Index - RSI applied to standard deviation

signal.bb

Bollinger Bands - Bollinger Bands — volatility envelope around a moving average using standard deviation bands

signal.trange

True Range - True Range — maximum of (high-low, |high-prev_close|, |low-prev_close|)

signal.chaikin_vol

Chaikin Volatility - Chaikin Volatility — rate of change of the EMA of the high-low spread

signal.bbpercent

Bollinger %B - Bollinger %B — position of price relative to the bands (0 = lower band, 1 = upper band)

signal.historical_vol

Historical Volatility - Historical Volatility — annualized standard deviation of log returns

signal.heikin_ashi

Heikin-Ashi - Synthetic candlestick transform that averages OHLC prices to reduce noise and clarify trend direction

Volume

signal.obv

On Balance Volume - Cumulative volume based on price direction

signal.vwap

Volume Weighted Average Price - Average price weighted by volume, reset daily

signal.ad

Accumulation/Distribution Line - Cumulative measure of money flow volume

signal.adosc

Chaikin A/D Oscillator - MACD of Accumulation/Distribution line

signal.cmf

Chaikin Money Flow - Measures buying/selling pressure over a period

signal.vpt

Volume Price Trend - Cumulative volume adjusted by percentage price change

signal.nvi

Negative Volume Index - Tracks price changes on days volume decreases

signal.pvi

Positive Volume Index - Tracks price changes on days volume increases

signal.vroc

Volume Rate of Change - Percentage change in volume

signal.tvi

Trade Volume Index - Accumulates volume based on tick direction

signal.pvo

Percentage Volume Oscillator - MACD for volume to identify volume trends

signal.market_facilitation

Market Facilitation Index - Measures efficiency of price movement per volume

signal.force

Force Index - Force Index — measures buying/selling pressure using price change × volume

signal.eom

Ease of Movement - Ease of Movement — relates price change to volume, measuring how easily price moves

signal.pvt

Price Volume Trend - Price Volume Trend — cumulative volume adjusted by percentage price change

signal.vwma_vol

Volume Weighted MA - Volume Weighted Moving Average — moving average weighted by volume

signal.vol_osc

Volume Oscillator - Volume Oscillator — percentage difference between short and long volume moving averages

signal.klinger

Klinger Volume Oscillator - Klinger Volume Oscillator — compares volume to price movement to predict reversals

Features

Features are continuous mathematical arrays that describe the structural state of the market, such as rolling microstructural liquidity, statistical variance, or phase-space divergence. They can be computed independently as standalone datasets via the Universe Loader, or natively routed into your Custom Logic scripts as conditional dependencies.

Mathematical Provenance

Kopie Quant adheres to strict mathematical purity. Every feature within the ecosystem is forensically audited and certified against canonical academic whitepapers (e.g., Amihud 2002, Rosenstein 1993) and standard public implementations (e.g., SciPy, Pandas). Our algorithms are engineered to achieve perfect statistical parity with leading institutional standards. We do not utilize "black-box" heuristics, ensuring the primitives utilized in your infrastructure are computationally undeniable.

Market Microstructure

feature.micro_tick_rule

Determines the implied trade direction (buyer-initiated vs. seller-initiated) by comparing the current price to the previous price. If the price goes up, it assigns 1.0; if down, -1.0; if unchanged, it carries forward the previous sign.

feature.micro_roll_spread

Implements Roll's (1984) model to estimate the effective bid-ask spread directly from the serial covariance of price changes, useful when exact order book data is unavailable.

feature.micro_dollar_volume

Represents the total fiat value exchanged per bar. A foundational liquidity metric that removes share-price bias when comparing trading activity across multiple assets.

feature.micro_turnover

Calculates the rolling aggregate volume over a given window divided by shares outstanding. This provides a clear metric of relative activity, measuring how fast the asset's liquidity pool is turning over.

feature.micro_amihud

Calculates the Amihud (2002) Illiquidity measure. It divides the absolute percentage return by the dollar volume over a rolling window. High values indicate that a small amount of dollar volume caused a massive price swing.

feature.micro_cs_spread

The Corwin-Schultz (2012) High-Low Spread estimator. It estimates the effective bid-ask spread by utilizing only the high and low prices over a rolling window. It elegantly isolates the spread component from fundamental volatility by analyzing the variance ratio of high-low ranges over 2-period versus 1-period intervals.

feature.micro_amivest

The Amivest Liquidity Ratio. Functionally the inverse of the Amihud measure, this ratio represents the aggregate dollar volume required to move the price by 1%. High values indicate deep liquidity, as significant capital is required to induce a price swing.

feature.micro_hui_heubel

The Hui-Heubel Liquidity Ratio. A relative measure relating the maximum price variance over a window to the asset's turnover rate (average volume over shares outstanding). Lower values denote high liquidity, implying the price remains stable despite heavy turnover. Note: Kopie Quant's Universe Loader automatically resolves and injects the canonical `shares_outstanding` from your institutional data feed at runtime. This parameter is exposed solely for manual overrides and hypothetical stress-testing.

feature.micro_martin

The Martin Liquidity Index. Measures liquidity degradation by summing the squared price range divided by volume over a window. A rising index implies that the available trading volume is struggling to absorb price volatility, denoting thinning liquidity.

feature.micro_kyle_lambda

Kyle's Lambda (1985). A cornerstone metric for market impact modeling, Lambda measures the price impact of a trade by regressing price returns against signed order flow (trade imbalance). A higher Lambda signifies lower liquidity, indicating a larger adverse price impact per unit of volume traded.

feature.micro_hasbrouck

Hasbrouck's Lambda (1991). An evolution of Kyle's Lambda, this metric models the concavity of market impact by regressing price returns against the square root of signed volume. A higher value indicates severe price impact and thin liquidity, as a relatively small order flow can displace the equilibrium price.

feature.micro_kyle_depth

Kyle's Market Depth. Mathematically the inverse of Kyle's Lambda. It quantifies the absolute order flow required to move the asset's price by a single unit (e.g., 1%). High values imply profound liquidity depth, signifying that the order book can absorb massive volume shocks without significant price dislocation.

feature.micro_market_impact

Market Impact Correlation. Measures the rolling Pearson correlation between absolute returns and trading volume over a window. It evaluates the structural relationship between volatility and volume; strong positive correlations suggest that volume spikes are actively driving price dislocation rather than resting passively in the book.

feature.micro_roll_impact

Roll Impact Ratio. A composite metric that divides the Roll Implied Spread by the asset's Dollar Volume. It estimates the implicit spread cost per unit of fiat liquidity. A rising Roll Impact signals liquidity exhaustion—either the spread is widening despite steady volume, or volume is collapsing while spreads remain structurally rigid.

feature.micro_trade_imbalance

Order Flow Imbalance. Calculates the normalized ratio of buyer-initiated volume versus seller-initiated volume over a trailing window. Values range from -1.0 (pure systemic selling pressure) to 1.0 (pure systemic buying pressure). Highly effective for detecting institutional accumulation or distribution phases prior to price action confirmation.

feature.micro_pastor_stambaugh

The Pástor-Stambaugh (2003) Liquidity Factor. Estimates the return-reversal effect induced by signed order flow using a multivariate OLS regression over a trailing window. A significantly negative gamma coefficient implies that large signed-volume shocks cause predictable return reversals the following period—a hallmark of illiquidity. Widely used in cross-sectional asset pricing to decompose systematic liquidity risk from idiosyncratic noise.

feature.micro_pin_proxy

Probability of Informed Trading (PIN) Proxy. Approximates the classical Easley-O'Hara PIN measure without requiring the full maximum-likelihood decomposition. It calculates the absolute imbalance between buyer-initiated and seller-initiated volume as a fraction of total volume. Higher values indicate a greater proportion of informed (directional) trading relative to uninformed (noise) flow.

feature.micro_rvol

Relative Volume. Measures the current bar's volume as a multiple of its trailing rolling average. An RVOL of 2.0 means the current bar traded at twice the normal volume. Primarily used to detect unusual activity events—institutional block trades, news catalysts, or algorithmic bursts—that deviate from the asset's baseline liquidity profile.

feature.micro_vzscore

Volume Z-Score. Standardizes the current bar's volume by subtracting the rolling mean and dividing by the rolling standard deviation. The output is a dimensionless z-score indicating how many standard deviations the current volume deviates from normal. Values above +2.0 represent statistically significant volume anomalies.

feature.micro_intraday_intensity

Intraday Intensity Index (Bostian). Measures the position of the close relative to the high-low range, weighted by volume, and accumulated over a rolling window. Values near 1.0 indicate that the close is consistently near the high on heavy volume (accumulation); values near -1.0 indicate consistent closes near the low on heavy volume (distribution).

feature.micro_variance_ratio

The Lo-MacKinlay (1988) Variance Ratio test. Compares the variance of q-period returns to q times the variance of single-period returns. Under a pure random walk, the ratio equals 1.0. Values significantly above 1.0 indicate positive serial correlation (trending behavior); values below 1.0 indicate mean reversion. A foundational tool for testing the Efficient Market Hypothesis at the microstructure level.

feature.micro_momentum

Microstructure Momentum. Computes the rolling mean of directionally signed returns (return × tick direction) over a window. This isolates the momentum component embedded in the order flow itself, distinguishing between price moves that are confirmed by the tick direction versus those that are against it. Consistently positive values indicate trend-following momentum aligned with order flow.

feature.micro_price_persistence

Price Persistence. Measures the probability that the sign of a return in one period will match the sign of the return in the subsequent period over a rolling window. A persistence score of 0.7 means 70% of consecutive bars had returns in the same direction. Values above 0.5 indicate trending tendencies; values below 0.5 indicate choppy or mean-reverting conditions.

feature.micro_liquidity_persistence

Liquidity Persistence (AR(1) of Amihud). Measures the autoregressive persistence of the Amihud illiquidity measure by regressing changes in Amihud against their lagged values over a trailing window. A coefficient near 1.0 implies liquidity conditions are "sticky"—once liquidity dries up, it stays dry. A coefficient near 0 implies liquidity shocks are transient and self-correcting.

Statistical Moments

feature.stat_mean

Rolling Arithmetic Mean. The most fundamental statistical moment—computes the simple average of a specified source column over a trailing window. While conceptually basic, its output is foundational to dozens of downstream features including z-scores, standardizations, and regime-relative comparisons. Supports flexible source column selection (returns, close, volume, etc.).

feature.stat_variance

Rolling Variance. Computes the second central moment of a specified source column over a trailing window with configurable degrees of freedom. Variance is the bedrock of volatility modeling—it quantifies the average squared deviation of observations from the rolling mean. Use ddof=1 for Bessel-corrected (sample) variance; ddof=0 for population variance.

feature.stat_stddev

Rolling Standard Deviation. The square root of the rolling variance—expressed in the same units as the source data. This is the canonical measure of realized volatility in quantitative finance. Historically annualized by multiplying by √252 for daily data. Supports flexible source column and degrees-of-freedom configuration.

feature.stat_skewness

Rolling Skewness. The third standardized moment—measures the asymmetry of the return distribution over a trailing window. Negative skewness (left tail) is common in equities, indicating that large drawdowns are more frequent than large rallies. Positive skewness implies the opposite. Used in risk management to adjust position sizing for tail asymmetry and in options pricing to calibrate smile dynamics.

feature.stat_kurtosis

Rolling Kurtosis. The fourth standardized moment—measures the "tailedness" of the return distribution. Higher kurtosis indicates heavier tails and a sharper peak relative to a Gaussian. Financial returns are almost universally leptokurtic (kurtosis > 3), meaning extreme events occur far more frequently than a normal distribution would predict. Essential for Value-at-Risk (VaR) and Expected Shortfall (ES) calculations.

feature.stat_excess_kurtosis

Rolling Excess Kurtosis. Defined as kurtosis - 3.0, this normalizes the kurtosis so that a Gaussian distribution has an excess kurtosis of exactly 0. Positive excess kurtosis means the tails are heavier than a normal distribution (leptokurtic); negative means they are lighter (platykurtic). This is the preferred metric for assessing tail risk in institutional risk models because it directly quantifies the deviation from normality.

feature.stat_semi_variance

Rolling Semi-Variance. Computes the variance of only the below-mean observations within a trailing window. Unlike symmetric variance, semi-variance exclusively captures downside dispersion—the risk that investors actually care about. This is the foundation of the Sortino Ratio and downside-risk-only portfolio optimization frameworks. A rising semi-variance with stable total variance implies increasing negative tail concentration.

feature.stat_mad

Mean Absolute Deviation (MAD). Computes the average absolute distance of each observation from the rolling mean. More robust than standard deviation to outlier contamination because it does not square the deviations—making it a preferred dispersion metric when the distribution contains heavy tails or when you want a linear (L1-norm) risk estimate. Supports flexible source column selection.

feature.stat_cv

Coefficient of Variation (CV). The ratio of the rolling standard deviation to the absolute rolling mean. This dimensionless metric normalizes volatility relative to the level of the series, allowing cross-asset and cross-timeframe risk comparisons. A CV of 2.0 means the standard deviation is twice the absolute mean—indicating extreme relative dispersion. Uses an epsilon guard against division by zero.

feature.stat_zscore

Rolling Z-Score. Standardizes the current observation by subtracting the rolling mean and dividing by the rolling standard deviation. The output quantifies how many standard deviations the current value deviates from its recent norm. Values beyond ±2.0 are statistically unusual; values beyond ±3.0 are extreme outliers. The canonical building block for mean-reversion strategies and Bollinger Band-style entry/exit signals.

feature.stat_autocorr

Rolling Autocorrelation. Computes the Pearson correlation between a series and its own lagged values over a trailing window. Autocorrelation at lag-1 reveals whether consecutive returns are serially dependent—positive autocorrelation suggests trending (momentum) behavior, while negative autocorrelation suggests mean reversion. Configurable lag enables multi-scale serial dependency profiling.

feature.stat_drawdown

Rolling Drawdown. Computes the percentage decline of the current price from its local windowed peak—not the global all-time high. A drawdown of -0.15 means the asset is currently 15% below its recent peak over the trailing window. This windowed approach avoids stale peaks from distant history dominating the signal and is more responsive to regime changes. Reference: Chekhlov, Uryasev & Zabarankin (2005).

feature.stat_pacf

Rolling Partial Autocorrelation (PACF). Isolates the direct linear relationship between a time series and its lagged self after removing the effects of all intermediate lags. Unlike ACF (which blends direct and indirect dependencies), PACF reveals which specific lag has a genuine causal relationship to the current observation. Critical for ARIMA model order selection and for detecting hidden structural dependencies in return series.

feature.stat_jarque_bera

Rolling Jarque-Bera Test Statistic. A goodness-of-fit test that jointly evaluates whether a sample's skewness and kurtosis match those of a normal distribution. The test statistic is JB = (n/6) × [S² + (K-3)²/4]. High JB values (typically > 5.99 at the 5% significance level) reject the null hypothesis of normality, indicating statistically significant fat tails or asymmetry—critical for validating Gaussian assumptions in VaR and portfolio optimization.

feature.stat_standard_error

Standard Error of the Mean (SEM). Computes the precision of the rolling mean estimate by dividing the rolling standard deviation by the square root of the window size. A smaller SEM indicates that the rolling mean is a more reliable estimator. Used in hypothesis testing to construct confidence intervals around rolling statistics and to determine whether observed alpha is statistically significant versus noise.

Structural Invariants

feature.struct_entropy

Shannon Entropy. Quantifies the information content (disorder/randomness) of the return distribution over a trailing window by histogramming observations into configurable bins and computing -Σ p·log₂(p). Maximum entropy indicates a uniform (maximally random) distribution; low entropy indicates concentration into a few dominant bins, suggesting structural order or regime dominance. Bridges statistical analysis into information theory—essential for detecting regime transitions.

feature.struct_hurst

The Hurst Exponent (R/S Analysis). A measure of the long-range memory (persistence) of a time series. H = 0.5 implies a pure random walk (no memory). H > 0.5 indicates persistent (trending) behavior where past moves predict future direction. H < 0.5 indicates anti-persistent (mean-reverting) behavior. Computed via Rescaled Range (R/S) analysis across multiple sub-period scales, then extracting the log-log regression slope. The foundational metric for fractal market analysis.

feature.struct_fracdiff

Fractional Differentiation (Marcos López de Prado). Applies a fractional order of differencing to the close price series, preserving memory while achieving stationarity. Traditional integer differencing (d=1) destroys all memory; fractional differencing (0 < d < 1) finds the minimum d required to make the series stationary while retaining maximum predictive information. The threshold parameter controls weight truncation for computational efficiency.

feature.struct_adf

Augmented Dickey-Fuller Test Statistic. The canonical unit root test for determining whether a time series is stationary. A more negative ADF statistic provides stronger evidence against the null hypothesis of a unit root (non-stationarity). Critical values are approximately -2.86 (10%), -3.41 (5%), and -3.96 (1%). Configurable regression type controls whether a constant, trend, or neither is included in the test regression.

feature.struct_kpss

KPSS (Kwiatkowski-Phillips-Schmidt-Shin) Test Statistic. The complementary stationarity test to ADF. While ADF tests the null of non-stationarity, KPSS tests the null of stationarity. A high KPSS statistic rejects stationarity. Using ADF and KPSS together provides a robust diagnostic: if ADF rejects and KPSS fails to reject, the series is confirmed stationary. If both reject, the series is difference-stationary with a structural break.

feature.struct_cusum

CUSUM (Cumulative Sum) Structural Break Filter. Monitors the cumulative deviation of returns from their rolling mean, triggering a signal when the deviation exceeds a configurable number of standard deviations (σ). The output represents the normalized CUSUM value—when it breaches the threshold, a structural break (regime change) is detected. Widely used in quality control and increasingly in algorithmic trading for adaptive stop-loss and regime-switching triggers.

feature.struct_wavelet

Wavelet Energy Decomposition. Applies a discrete wavelet transform (DWT) to decompose the return series into frequency-domain components, then computes the energy (sum of squared coefficients) at a specified decomposition level. High energy in the detail coefficients indicates significant high-frequency volatility; energy concentrated in the approximation coefficients indicates low-frequency trend dominance. Configurable wavelet family (Daubechies, Haar, Symlet) and decomposition level.

feature.struct_lyapunov

Largest Lyapunov Exponent (Rosenstein Method). Quantifies the sensitivity to initial conditions—the hallmark of deterministic chaos. A positive Lyapunov exponent indicates chaotic dynamics where nearby trajectories in phase space diverge exponentially. A negative exponent indicates convergence (stable dynamics). Computed by embedding the time series into a reconstructed phase space using Takens' theorem, then measuring the average divergence rate of nearest neighbors.

feature.struct_fractal_dim

Fractal Dimension. Derived directly from the Hurst Exponent via the relation D = 2 - H. A fractal dimension of 1.5 indicates a pure random walk (Brownian motion). D < 1.5 indicates a smooth, trending path (persistent). D > 1.5 indicates a rough, jagged path (anti-persistent/mean-reverting). This provides a geometric interpretation of market structure that is invariant to scale—the same fractal properties hold whether you look at 1-minute or 1-day bars.

feature.struct_mutual_info

Mutual Information (MI). An information-theoretic measure of the nonlinear statistical dependency between a time series and its lagged self. Unlike autocorrelation (which only captures linear dependency), MI detects any form of dependency—including nonlinear, threshold, and regime-dependent relationships. Computed via MI = H(X) + H(Y) - H(X,Y) using natural logarithm (nats). MI = 0 implies statistical independence; higher MI indicates stronger dependency.

feature.struct_hurst_of_ema_spread

Hurst Exponent of EMA Spread. A composite structural feature that first computes the spread between close price and its EMA, then applies R/S Hurst analysis to that spread. This isolates the fractal memory of the deviation from trend—answering: "Does the mean-reversion signal itself have structural persistence?" H > 0.5 on the spread implies the gap widens (trending deviation), making mean-reversion dangerous. H < 0.5 implies the spread is self-correcting, validating mean-reversion strategies.

Temporal & Regime

feature.regime_vol_label

Volatility Regime Labels. Classifies the current volatility level into one of three regimes (Low=0, Medium=1, High=2) by computing the percentile rank of the current rolling standard deviation against its own trailing distribution over a configurable lookback. If current vol is in the bottom 33rd percentile, the regime is Low; top 33rd is High. This enables condition-specific strategy deployment—e.g., selling premium in High vol, running breakout systems in Low vol.

feature.regime_autocorrelation

Return Autocorrelation Regime. Computes the rolling Pearson correlation between returns and their 1-period lag over a trailing window. Unlike stat_autocorr (which is a raw statistical output), this feature is designed for direct regime consumption—positive values indicate momentum-favorable conditions, negative values indicate mean-reversion-favorable conditions, and near-zero values indicate random-walk behavior where neither strategy has an edge.

feature.regime_hmm

Gaussian Mixture Model (GMM) Regime States. Fits a k-component 1D Gaussian Mixture via Expectation-Maximization (EM) on the trailing return distribution, then classifies the current observation by posterior probability. States are sorted by mean return level (State 0 = lowest mean/bearish, State N = highest mean/bullish). Outputs the discrete state label and per-state posterior probabilities. Reference: Dempster, Laird & Rubin (1977); McLachlan & Peel (2000).

feature.regime_hurst_persistence

Hurst Persistence Regime. A binary regime classifier derived from the Hurst Exponent. If H > threshold (default 0.5), the regime is labeled as "persistent" (1.0), indicating trending market conditions. If H ≤ threshold, the regime is labeled as "anti-persistent" (0.0), indicating mean-reverting conditions. This is the simplest possible fractal regime filter—a single boolean gate for strategy selection.

feature.regime_recovery

Recovery State. A binary indicator that tracks whether the asset is currently recovering from a drawdown (1.0) or still declining (0.0). Computed by comparing the current drawdown to the previous bar's drawdown—if the drawdown is improving (becoming less negative), the asset is in recovery. This simple but powerful signal is used for dip-buying strategies, risk budget reallocation, and drawdown-aware position management.

feature.regime_hmm_on_macd

Gaussian Mixture Regime on MACD Signal Line. Applies Gaussian Mixture Model (GMM) regime classification not to raw returns, but to the MACD signal line—a momentum derivative. Computes MACD inline (EMA_fast - EMA_slow smoothed by signal EMA), then fits a k-component GMM via EM on the trailing signal distribution. States are sorted by mean signal level (State 0 = bearish momentum, State 2 = bullish acceleration). Reference: McLachlan & Peel (2000); Hamilton (1989).

feature.stat_skew_of_rsi

Rolling Skewness of RSI. Computes the third moment (skewness) of the RSI indicator itself over a trailing window. This is a second-order feature—it measures whether the RSI distribution is asymmetric over recent history. Negative skew of RSI means the indicator has spent more time near extreme lows (oversold clustering). Positive skew means overbought clustering. Detects regimes where oscillator behavior is structurally biased rather than mean-reverting.

feature.stat_kurt_of_rsi

Rolling Kurtosis of RSI. Computes the fourth moment (kurtosis) of the RSI indicator over a trailing window. High kurtosis of RSI means the oscillator is spending most of its time in a narrow range with occasional extreme excursions—indicating a "coiled spring" condition where the next breakout could be violent. Low kurtosis indicates a more uniformly distributed RSI with stable oscillatory behavior.

feature.stat_entropy_of_bb_pctb

Shannon Entropy of Bollinger %B. Applies information-theoretic entropy analysis to the Bollinger Bands Percent B indicator. Low entropy of %B means the indicator is stuck in a narrow range (low information/high predictability)—often preceding a volatility expansion. High entropy means %B is uniformly distributed across its range, indicating maximum uncertainty. This composite feature bridges technical analysis (Bollinger Bands) with information theory for volatility regime anticipation.