PatternX methodology

How PatternX backtests work: assumptions and limits

By the PatternX team · Published

Short answer

A PatternX backtest replays the same deterministic pattern engine bar by bar over up to 1,500 recent candles, charging 0.03% slippage per fill, 0.05% fees per side and 0.01% funding per 8 hours, and assuming the stop comes first when one bar touches both levels. It reports in-sample and out-of-sample results and a 400-run Monte Carlo, but does not model the risk engine, trailing stops or live market context.

What a backtest can tell you

A backtest replays fixed rules over past data and reports what would have happened under stated assumptions. It is one sample of history, not a forecast: the same rules can do better or worse on the next stretch of data (probability vs certainty). PatternX runs two kinds: signal-engine backtests for chart patterns and Momentum Lab backtests for premarket strategies.

Signal-engine backtests

The replay

PatternX replays the same deterministic pattern engine it runs live, bar by bar, after 120 warm-up bars, in Classic or AI mode; AI mode needs Pro or Elite (Classic vs AI). At each step the engine sees only the bars up to that point. Each series, meaning one venue, symbol and timeframe, holds at most one simulated position at a time.

Inputs and defaults

You choose 1–5 venues, 1–20 symbols, any timeframes and patterns, and the 200–1,500 most recent candles (default 1,000). Defaults: take-profit 10%, stop-loss 5%, minimum confidence 65, risk 1% per trade, leverage 3, a $10,000 starting balance, longs and shorts both on. History depth depends on the venue and the timeframe: 1,000 five-minute bars of a 24/7 crypto market cover about 3.5 days, and 1,500 one-hour bars about 62 days. A venue that returns fewer bars tests less history.

Costs and fill rules

  • Entry at the signal bar's closing price plus 0.03% slippage; exits at the stop or target less 0.03%, both against you.
  • When one bar touches both the stop and the target, the stop is assumed to come first.
  • Fees of 0.05% per side.
  • Funding of 0.01% per 8 hours, always charged, including on stocks and FX, which have no perpetual funding; their real carrying costs, such as margin interest or overnight rollover, differ.
  • A liquidation check, so high leverage with a wide stop can end in liquidation before the stop.
  • Trades still open at the end close at the last bar's closing price.

What you get back

  • Core results: win rate, profit factor, net P&L, maximum drawdown, average win and loss, and an equity curve.
  • Breakdowns by pattern, timeframe, exchange, symbol, side and market regime.
  • Robustness statistics: Sharpe, Sortino, expectancy, CAGR, holding time, drawdown duration, longest losing streak, time in market and a buy-and-hold benchmark.
  • In-sample against out-of-sample: the first 70% of the tested period against the last 30%.
  • A Monte Carlo of 400 reshuffles of the trade order, reporting the 5th-percentile, median and 95th-percentile return and the 95th-percentile drawdown.
  • A warning when there are fewer than 30 trades.
  • An optional written summary from a language model, produced after the numbers; it describes them and cannot change them.

Optimization Lab

On Pro and Elite, the Optimization Lab runs a grid of up to 12 variants over take-profit × stop-loss × minimum confidence and ranks them with a robustness formula weighted toward out-of-sample and Monte Carlo results rather than headline return, discounting variants with few trades.

Plan limits

Free has no backtesting. Starter has basic backtests (1 venue, 3 symbols, 2 timeframes). Pro and Elite get full backtests and the Optimization Lab (pricing).

What the replay leaves out

  • Neutral market context. History has no order book, so the liquidity, spread, order-book, funding and 24-hour-volume filters are effectively off.
  • No higher-timeframe or historical-win-rate input, so a setup's backtest score can differ from its live confidence score; see the PatternX Score.
  • No risk engine: quotas, loss limits, cooldowns and margin checks are not applied (risk controls).
  • No trailing stop or break-even, no approval delay and no partial fills.
  • Fixed sizing: every trade risks the same share of the starting balance (1% by default), with no compounding, and take-profit and stop-loss are price percentages only.
  • Finished bars: the replay sees each bar complete, while a live signal can fire on a bar that is still forming.
  • Data depth depends on what the venue returns.

Momentum Lab backtests

Elite only. A run covers up to 25 symbols and 30 trading days, with a grid of up to 150 combinations across entry %, trail %, spread, premarket volume, market-cap preset and continuation confirmations. It uses your data source's 1-minute extended-hours bars and fails rather than fabricate missing data. Default assumptions: 0.2% spread, 0.05% slippage, $1,000 per trade and $0 commission. Not replayed: quote size, halts, the AI filter and relative volume. Today's market cap is applied to every past day, so a stock that has since grown past your preset can appear in results even if it was below it then. Inside each 1-minute bar the replay has to assume an order of prices, which the real tape may not have followed. See the guide's backtesting section and the Momentum Lab methodology.

How to read a backtest honestly

  1. Count the trades. Under 30, PatternX warns you; treat the result as an anecdote. Breakdowns slice the sample thinner still.
  2. Compare in-sample and out-of-sample. If the edge fades in the last 30%, the rules may fit the first 70% rather than the market.
  3. Read the Monte Carlo for drawdown. Trades are sized identically and only reordered, so their sum cannot change and the return percentiles match the actual result. The useful number is the 95th-percentile drawdown: how deep a bad ordering of the same trades could go.
  4. Check the costs against your venue. A 0.03% slippage is small for thin markets and fast breakouts; compare 0.05% per side with your actual fee tier.
  5. Watch for overfitting. With 12 variants, the top-ranked one can owe part of its lead to chance. Prefer settings whose neighbours also hold up, and once you pick a variant for its out-of-sample result, that period is no longer unseen, so paper trade it before going live.
  6. Compare with doing nothing. Check the buy-and-hold benchmark and the time in market.
  7. List what was not modelled before trusting any number, using the section above and PatternX's limitations.

Frequently asked questions

Will my live results match the backtest?

Not exactly. Live trading adds forming bars, real spreads and fills, the risk engine, trailing stops and approval delays, none of which the replay models, and the market can simply behave differently.

Why does a setup score differently in a backtest than live?

The replay uses a fixed, neutral market context and has no higher-timeframe or historical-win-rate input, so the same geometry can earn a different confidence score live.

Can I backtest on the Free plan?

No. Starter includes basic backtests (1 venue, 3 symbols, 2 timeframes); Pro and Elite include full backtests and the Optimization Lab.

Does PatternX AI change backtest results?

Only if you run the backtest in AI mode: then the same fixed context evaluation used live can drop or re-weight setups. Stops, targets and the cost model stay the same in both modes.

How many trades does a backtest need to mean something?

There is no magic number, but PatternX warns below 30 trades and the Optimization Lab discounts such variants. Many more trades, spread across different market conditions, make a result harder to explain by luck.

Related reading

Educational content, not financial advice. Chart patterns describe probabilities, not certainties; trading — especially with leverage or outside regular hours — can lose money, including more than you expect. See the risk disclaimer.