Appearance
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:
- Fetches OHLCV data for the configured ticker and frequency.
- Runs the selected indicator on the full OHLCV series, producing a value at each bar.
- Applies the position rule to the indicator values to determine whether the strategy is long (invested) or flat (cash) on each bar.
- 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
| Indicator | Description |
|---|---|
| SMA Crossover | Ratio or difference between a fast and slow simple moving average. Goes long when the fast SMA is above the slow SMA. Configurable windows (e.g., 20/50 days). |
| EMA Crossover | Same logic as SMA Crossover but uses exponential moving averages, which weight recent prices more heavily. Reacts faster to trend changes. |
| P/MA Momentum | Price divided by its own N-day moving average. Values above 1.0 indicate price is above the trend line; values below 1.0 indicate below. Simple, interpretable momentum proxy. |
| Slope | Linear regression slope of closing price over a lookback window, normalized by price level. Positive slope = uptrend; negative = downtrend. |
| Curvature | Second derivative of price (rate of change of slope). Captures acceleration and deceleration of trends. Useful for detecting trend exhaustion. |
| ADX | Average 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
| Indicator | Description |
|---|---|
| RSI | Relative 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. |
| CCI | Commodity 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 | Width or %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
| Indicator | Description |
|---|---|
| OBV | On-Balance Volume — cumulative volume adding up-days and subtracting down-days. Rising OBV alongside rising price confirms trend; divergence signals potential reversal. |
| ATR | Average True Range — average of true range (max of high-low, high-prevclose, prevclose-low) over N days. Measures volatility in price units. Useful as a position-sizing input or for filtering low-volatility regimes. |
| Volatility Ratio | Short-term ATR divided by long-term ATR. Values above 1.0 mean recent volatility is elevated relative to baseline. Can be used to go flat during high-volatility regimes. |
| VWAP Deviation | Deviation 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.