Deepmoney

How the test works

Data

Daily bars from 1996 (or the listing date) to the last close, adjusted for splits and dividends, from Financial Modeling Prep. US-listed stocks and ETFs only. A ticker needs at least 8 years of history.

Reading your rules

A language model (Anthropic's Claude) translates your text into a fixed set of conditions: close, open, high, low, volume, simple and exponential moving averages, RSI (Wilder), MACD 12/26/9, Bollinger bands (2 standard deviations), N-day highs and lows (excluding today), N-day returns, distance below an N-day high, ATR, average volume, crossovers, a stop loss, a take profit and a time exit. The report shows exactly how your text was read. The model does no calculations; every figure is computed by the backtest code.

Trading assumptions

Long or flat, one position at a time. Signals use the day's close and the position changes at that close. Stops and targets are checked on closes, not intraday. Each buy and each sell costs 0.05% of the position. Cash earns nothing. If your rules have no sell condition, the position is held while the buy condition is true.

Variants

Every number in your rules (each indicator period, threshold, stop and time limit) is scaled by 0.7, 0.85, 1, 1.15 and 1.3 (or 0.75, 1 and 1.25 when there are 3 or more numbers), in every combination, up to 81 variants including your rules as written.

Walk-forward, out of sample

The first year of data warms up the indicators. From then on, before each test year, the variant with the highest Sharpe ratio over the previous 5 years is chosen and traded for that year. The test years are stitched together into one out-of-sample record. Buy-and-hold and your rules as written are measured over the same years.

Statistics

CAGR, maximum drawdown and annualized Sharpe ratio (risk-free rate 0) of the daily returns. The deflated Sharpe ratio (Bailey and López de Prado, 2014) is computed on the daily walk-forward return minus buy-and-hold's: the probability that its true Sharpe ratio is above the best one expected by chance from the number of variants tried, given their spread, the record's length, skewness and fat tails. The p-value is 1 minus that probability.

Verdict

Edge when the p-value is 0.05 or less: the strategy beat buy-and-hold out of sample by more than trying that many variants would explain. Otherwise No edge. A verdict is a statement about the past, not a forecast.

ML-model variants (subscribers)

Logistic regression, gradient-boosted trees and a neural network (two hidden layers, 32 and 16 units) from scikit-learn, each retrained before every test year on all earlier days. Features: 1-, 5- and 20-day returns, RSI(14), distance from the 50- and 200-day averages, 20-day average absolute return, MACD histogram, and the gaps between the two sides of each of your conditions. The model is long when it gives the next close a better than 50% chance of being up. Deflated for your rule variants plus the three models.