Skip to content

Indicators ​

A technical indicator is a function that transforms raw OHLCV price data into a time series of numbers. In MarketHeist, indicators are the first half of a strategy: they measure some aspect of price behavior, and a position rule converts that measurement into a long/flat signal.

How indicators are applied ​

For each backtest, MarketHeist:

  1. Fetches OHLCV data for the configured ticker and frequency.
  2. Runs the selected indicator on the full OHLCV series, producing a value at each bar.
  3. Applies the position rule to the indicator values to determine whether the strategy is long (invested) or flat (cash) on each bar.
  4. Simulates returns assuming end-of-bar execution (no lookahead bias within a bar).

Indicator values during the warm-up period — the initial bars needed to compute the first valid value — are treated as NaN and the position rule defaults to flat during that window.

TIP

To learn how position rules translate indicator values into long/flat signals, see Position Rules.

Built-in indicators ​

Trend & momentum ​

IndicatorDescription
MA CrossoverShort moving average divided by long moving average (SMA or EMA, selectable). A value above 1.0 means the short MA is above the long MA. Configurable windows (e.g., 10/52 bars).
EMA CrossoverShort EMA divided by long EMA. Weights recent prices more heavily than SMAs, so it reacts faster to trend changes. Above 1.0 means the short EMA is above the long EMA.
MA CurvatureSecond derivative of a moving average, normalized by its rolling standard deviation. Captures acceleration and deceleration of trends. Values above 0 mean the trend is accelerating; useful for detecting trend exhaustion.
ADXAverage Directional Index — measures the strength of a trend without indicating direction. High ADX (>25) indicates a strong trend; low ADX (<20) indicates a ranging market. Typically used as a filter alongside a directional indicator.

Mean-reversion & oscillators ​

IndicatorDescription
RSIRelative Strength Index (0–100). Values above 70 are conventionally "overbought"; below 30 are "oversold." In a trend-following configuration, RSI > 50 can signal continued upside.
CCICommodity Channel Index. Oscillates around zero; large positive values indicate price is far above its moving average (potential overbought); large negative values indicate far below.
Stochastic%K oscillator (0–100) comparing closing price to the high-low range over a lookback window. Often smoothed with %D. Values near 100 indicate price closed near the top of the recent range.
Bollinger Bands%B of Bollinger Bands (price position within ±2σ bands). %B above 1.0 means price is above the upper band (breakout signal); %B below 0.0 means price is below the lower band.

Volume & volatility ​

IndicatorDescription
OBV MomentumOn-Balance Volume (cumulative volume, adding up-days and subtracting down-days) divided by its own moving average. Above 1.0 means volume is confirming the uptrend; below 1.0 signals distribution.
ATR %Average True Range (max of high-low, high-prevclose, prevclose-low, Wilder-smoothed) expressed as a percentage of the closing price. Useful for filtering low-volatility regimes or as a position-sizing input.
Volume RatioCurrent volume divided by its rolling average volume. Values above 1.0 mean above-average participation. Volume has no direction, so combine it with a price-based indicator.
VWAP DeviationDeviation of closing price from the rolling Volume Weighted Average Price, expressed as a percentage. Positive values mean price is above VWAP; negative means below.

Custom indicators ​

You can write your own Python indicator using the compute(df, params) contract. See Custom Indicators for the full specification and an example.

MarketHeist Backtest Engine