Strategy table
This page explains the indicator-strategy table at /strategies: where each row comes from, what the category tag means, how the average numbers are computed, and what changes when a regime is selected. It does not describe the fundamental long/short books or the portfolio optimizer. Those use different data and a different table.
What the table is
One row is one registered strategy. The live page reads public/strategies-data.json,
which is a compact copy of the averaged backtest summary. Opening a name goes to
/backtest/strategies/[id], where the per-index equity curve, monthly returns, and trades for that rule are loaded from
strategy-[id].json.
The default sort is Sharpe, highest first. The page shows 25 rows at a time. The homepage widget uses the same file and the same regime control, with five rows per page.
Category tag
The tag beside each name is the family stored on that strategy in the engine registry
(STRATEGIES in engine/src/backtest/strategies/__init__.py).
It is not a performance ranking and it is not inferred from the backtest result. The Category filter on the strategies page uses the same label.
- Trend. Directional rules: moving-average stacks, ADX, MACD state, pullbacks that only fire while a trend filter is on.
- Momentum. Rate-of-change, oscillator crosses, and momentum that must persist with a second filter.
- Mean Reversion. Entries that buy a stretch away from a band, z-score, or oscillator extreme, usually only inside a stated regime.
- Breakout. Closes through a prior high, Donchian level, or band, often with a confirmation filter.
- Channel. Keltner, price-channel, and volatility-expansion rules.
- Volume. Rules whose signal is built from volume, money flow, or an accumulation line.
- Oscillator. Single-oscillator rules such as CCI and Williams %R that are not filed under the families above.
A multi-filter rule is tagged by the module it lives in. A pullback that requires an uptrend is Trend. A fade of a band inside a quiet market is Mean Reversion. A break that also asks for money flow is Breakout.
Price data
The index list is the indices array in engine/config/symbols.json.
The current table uses the 25 indices that returned a usable daily history, including the S&P 500, Nasdaq Composite, Dow Jones, Russell 2000, FTSE 100, DAX, CAC 40, Nikkei 225, Nifty 50, Hang Seng, and others. Each series is daily OHLCV from Yahoo Finance, requested as five years, and kept in engine/cache.
Bars are sorted, duplicate timestamps are dropped, and timezone-aware indexes are made naive before the backtest. Volume is present when the vendor supplies it. Indicators that need volume treat a missing volume series as a constant, so a money-flow reading on an index with empty volume is only the close’s location inside the bar.
How a strategy decides
Every row is a backtesting.py strategy class. Single-indicator rules live next to the multi-filter rules in the same Python modules. A class computes its indicators in init and, on each bar, either buys, closes, or does nothing.
The books are long-only. A buy signal while flat opens a long. A close signal while long flattens. There is no short entry. The signal is evaluated on the bar’s close. The fill is the next bar’s open. Commission is 0.10% of traded value on each fill. There is no separate slippage model.
A multi-filter rule is the conjunction of its entry clauses and the disjunction of its exit clauses. An example is EMA Stack + MACD Cross: enter only when EMA 20 is above EMA 50, EMA 50 is above EMA 200, and the MACD histogram crosses above zero. Exit when the short stack breaks or the histogram is negative. Comparisons against a missing or NaN indicator are false, so the strategy stays flat through the warmup.
The registry holds 540 indicator strategies. The later entries are long-only daily adaptations of publicly documented indicator methods, including Ichimoku, Supertrend, SSL, range filters, ATR trailing stops, T3, ALMA, KAMA, Fisher, WaveTrend, QQE, Laguerre RSI, Connors RSI, turtle channels, and candle or volume rules. Each one is an original Python class. Protected Pine source is not copied.
Opening a strategy shows two blocks from that class. The methodology is the class docstring: what is bought, what closes the trade, and which published rule it follows. The code block is the class source, extracted by scripts/generate_strategy_methodology_code.py into strategy-methodology-code.json.
How the default row is averaged
engine/run_local.py runs every registered strategy on every index. For each symbol it writes one run: equity curve, monthly returns, trade list, Sharpe, total return, max drawdown, win rate, and trade count. Those runs are stored in data/backtest-results-indices/strategy-[id].json.
scripts/build-summary-from-indices.mjs reads every strategy file and replaces the table numbers with the unweighted mean across that strategy’s symbol runs. Sharpe on the default row is the mean of the per-index Sharpes, not a Sharpe computed on a stitched portfolio. Return, max drawdown, and win rate are means in the same way. Trades are the sum of trades across indices. Symbols count is the number of runs.
scripts/build-strategies-data.mjs then writes strategies-data.json for the website, and adds two quality fields measured from each run: average number of bars covered, and average share of bars with a position open. If a stop-loss and take-profit sweep exists for that id, the displayed Sharpe, return, drawdown, and win rate are replaced by the sweep point with the highest Sharpe. The SL and TP columns are that point. Strategies with no sweep show a dash.
The statistical-efficiency column is separate. It is the share of validation gates passed in data/statistical-validation/validation-[id].json, when that file exists. It is not recomputed when you change the regime view. What each gate checks, and how the verdict is assigned, is described on the strategy evaluation page.
Columns
- Strategy. Display name, link, and category tag.
- Sharpe. In the average view, the mean per-index Sharpe from the backtest engine. In a regime view, the annualized Sharpe of monthly returns inside the chosen regime.
- Stat %. Validation gates passed, unchanged by the regime control.
- Return %. In the average view, mean total return over each index’s full sample. In a regime view, the compounded return of only the months in that regime, averaged across indices.
- Max DD %. In the average view, mean of each index’s peak-to-trough drawdown. In a regime view, the drawdown of the path formed by stitching that regime’s months in calendar order, then averaged across indices. Those months are not a continuous holding period.
- Win %. In the average view, the share of closed trades that made money. In a regime view the header becomes Up months %, the share of regime months with a positive strategy return.
- Trades. Sum of closed trades across indices. In a regime view the header becomes Months, the average number of months that index spent in the displayed regime.
- SL / TP. Best stop and target from the sensitivity sweep, as a percent of price. These stay on the full sample even when a regime is selected.
Quality filter
The filter is on by default. A row is hidden unless it has at least two symbols, a full-sample Sharpe of at least −1, at least 500 bars of history when that length is known, and at least 5% of bars in a position when that share is known. The time-in-market floor is intentionally low so a selective oscillator is not removed for sitting in cash. The filter always uses the full-sample statistics, including while a regime view is selected. The minimum-Sharpe box, by contrast, applies to the Sharpe currently shown in the table.
Regime view
The Performance dropdown has five choices. Average (full sample) is the row described above. The other four each pick, for that strategy, the single regime in which its annualized monthly Sharpe was highest, and they replace Sharpe, return, drawdown, and up-month rate with figures from only those months. The Regime column names that state.
Regimes are labeled from each index’s own month-end closes, not from a shared global clock. The label applied to a strategy’s return in month M is the index state at the previous month-end, so the classifier does not use the return it is scoring. A regime is eligible only when at least eight months are available on a symbol. Symbol-level Sharpes are then averaged with weights equal to the number of months. The file is public/data/strategy-regimes.json, written by scripts/build_strategy_regimes.py from the stored monthly returns and the cached daily prices.
- Trend. Bull trend when the month-end close is above its 10-month average. Bear trend otherwise.
- Volatility. Standard deviation of the prior six monthly index returns. High volatility when that value is at or above the index’s own median, low volatility when it is below.
- Momentum. Up momentum when the prior 12-month price change is positive. Down momentum otherwise.
- Drawdown. Close relative to the highest close of the prior 12 months. Near highs if the drawdown is shallower than 5%. Correction from 5% through 15%. Deep drawdown beyond 15%.
The regime return is not an annualized full-sample return, and the up-month rate is not a trade win rate. A strategy can lead the Trend view because it did well in bull months and still have a poor full-sample Sharpe.
Generation order
- Fetch or load cached daily bars for each index.
- Run each registered strategy class through the backtest engine and write one
strategy-[id].jsonwith a run per index. - Average those runs into
summary.jsonandstrategies.json. - Attach the registry category to each summary row. The backtest run itself does not carry the family name.
- Build
strategies-data.json, including quality fields and statistical-efficiency scores. - Build
strategy-regimes.jsonfrom monthly returns and month-end index states. - Copy the JSON the browser fetches into
public/.
Re-running the engine overwrites the per-strategy files. The summary, the website JSON, and the regime file then have to be rebuilt in that order, or the tags and the regime dropdown will describe a previous run.
Limits
The average treats each index equally, including indexes with short histories. It is not a capital-weighted portfolio and it does not subtract the cost of rotating between indexes. Regime months are grouped after the fact. They are not a separate backtest with its own orders, and a drawdown inside one regime ignores the months that fell in another regime. Yahoo Finance index history can differ from an exchange’s official series. None of these figures are a forecast or a recommendation to trade the rule.
Open the strategy table or read the backtesting engine notes.