Strategies & Tips

Manual Backtesting for Chart Patterns: Step-by-Step

By Christopher Downie6 min read
Manual Backtesting for Chart Patterns: Step-by-Step

Manual backtesting evaluates a written trading plan by moving through historical data in sequence and recording decisions before revealing the outcome. For chart patterns, the key challenge is applying the same definition to winners, losers, and ambiguous formations.

You need historical charts, a way to restrict future information, and a structured test log. LuxAlgo’s native charts can support chart inspection and annotation, while Quant, our coding agent, can help implement rules once they are precise enough to test systematically. Neither manual review nor automation guarantees a profitable strategy.

1. Define One Pattern Before Testing

Choose one market, timeframe, and pattern definition for the initial test. “A good-looking bull flag” is too subjective to reproduce. Specify the preceding move, the consolidation boundaries, the breakout condition, and when the setup expires.

There is no universal requirement that every chart pattern span 5% of price, last 5–20 candles, or show a fixed volume increase. Those can be research parameters for a particular strategy, but they need justification and testing. Volume profile describes volume by price; it is not the same measurement as a percentage increase in total bar volume.

Write the following before revealing subsequent prices:

  • Pattern rules: Which points define the shape, how they are selected, and when they become known.
  • Entry trigger: An intrabar touch, a closing break, or another precise event.
  • Execution: The order type and the earliest assumed fill after the signal.
  • Exit rules: Stop, target, time exit, and what happens if several conditions occur together.
  • Exposure: Position size, concurrent trades, and whether additional entries are allowed.
  • Filters: Any session, trend, or volume conditions, using information available at the decision time.

2. Prepare Charts and a Test Log

Record the exact symbol, data source, interval, timezone, session, and historical dates. Check missing bars, stock adjustments, or futures contract changes where relevant. Use enough earlier data to initialize any indicators.

On LuxAlgo’s native charts, mark the structure you want to study using the drawing tools. Keep only indicators required by the test. Adding several filters after seeing a losing trade changes the strategy rather than validating the original one.

Native LuxAlgo charts support chart review. A full historical chart remains vulnerable to hindsight unless future information is restricted separately.

Use a spreadsheet or another structured record for simulated trades. Keep this research log separate from actual-account performance so hypothetical outcomes are not confused with executed trades.

Conceal Future Information

Use a verified historical replay environment or a dataset cut off at the decision time. Simply scrolling an unrestricted chart into the past is weaker: later bars, indicators, or drawings may still reveal the outcome.

TradingView documents Bar Replay for stepping through supported historical data. Its dedicated historical trading feature is separate from normal live-connected trading. Ordinary broker or Paper Trading quotes and orders should not be assumed to follow the replay clock. Check the mode and available history before using it for a test.

Do not assume every charting platform has the same replay capability. The native LuxAlgo drawing workflow shown here is for annotation; it does not demonstrate a historical replay engine.

3. Choose a Contiguous Test Period

Set the dates before looking for examples. Review every eligible opportunity in sequence rather than collecting attractive patterns from screenshots. Keep failed formations and rejected setups with a reason for rejection.

Reserve a later period for evaluation after development. If you use that period repeatedly to adjust rules, it becomes development data too. Include different conditions where available, but do not select only the regimes in which your pattern looks successful.

Thirty or fifty trades can help reveal process problems, but neither count guarantees reliability. Evidence depends on the number of distinct opportunities, their dependence, the range of conditions, and how many strategy variations were tried. Many overlapping trades during one trend do not provide the same information as independent episodes across time.

4. Record the Decision Before the Outcome

  1. Advance to the next decision point. Reveal only the information your rules permit.
  2. Classify the setup. Mark eligible, rejected, or ambiguous, with the rule supporting that decision.
  3. Save the plan. Record the trigger, intended entry, stop, target, size, and a screenshot before continuing.
  4. Reveal later data. Apply the fixed fill and exit assumptions.
  5. Log the result. Preserve the original decision and add the outcome separately.

If a pivot requires two subsequent candles to confirm it, the pivot is unavailable until those candles exist. Similarly, a completed daily indicator value cannot inform an earlier intraday decision on the same day.

For discretionary patterns, repeat a small blinded subset later or have a second reviewer apply the written rules. Disagreement reveals where the definition needs clarification. Clarify during development, then freeze the definition for evaluation.

5. Work Through a Simulated Trade

The following is hypothetical arithmetic, not a market example or a recommendation. Assume a setup has already met your written pattern criteria and a closing signal produces an entry at the next available modeled price.

FieldExampleInterpretation
Modeled entry$50.10Recorded after the qualifying signal.
Initial stop$49.00$1.10 planned price risk per share.
Position100 shares$5,010 exposure and $110 planned price risk.
Target$52.30$2.20 potential reward per share, or 2R before costs.
Hypothetical exit$52.30$220 gross profit if this fill occurs.
Total modeled costs$10Deduct once; do not double-count costs already embedded in fills.
Net result$210$210 ÷ $110 = approximately 1.91R.

Here, R means the original planned price risk, not a guaranteed loss cap. If a gap forces an exit at $48.50, the same position loses $160 before costs. A stop price is not necessarily the execution price.

If one bar touches both the stop and target and the sequence is unknown, do not award the target by default. Apply a rule chosen beforehand, such as a conservative stop-first assumption, and record the ambiguity. If you use finer data to resolve it, use the same policy for every comparable trade.

6. Analyze Results with Consistent Definitions

  • Win rate: Profitable trades divided by all closed trades, with an explicit treatment of breakeven trades.
  • Average net result: Total net profit or loss divided by the number of trades.
  • Profit factor: Sum of positive trade results divided by the absolute sum of negative results. State whether those trade results include costs; no losing trades makes the ratio uninformative.
  • Realized payoff: Average winning trade divided by the absolute average losing trade. This differs from the planned target-to-stop ratio.
  • Maximum drawdown: The largest peak-to-trough decline in the equity series you measure. A closed-trade-only curve can miss losses while positions remain open.
  • Excursions: Maximum adverse and favorable movement during a trade, measured consistently relative to entry. They are not the same as account drawdown.

Compare pattern groups only when enough examples exist to make the comparison useful. Document how a market regime was classified at the time; a label derived from future prices leaks information into the test.

Look for concentration. A profitable sample dominated by one large winner or a single market episode warrants a different interpretation from broadly distributed results. Neither observation establishes future performance.

7. Use Automation After the Rules Are Clear

Manual review is useful for developing definitions and inspecting individual decisions. Automation can apply explicit rules repeatedly and reduce calculation work. Neither method has a universal accuracy rate or a guaranteed speed advantage once setup and verification are included.

Ask Quant to implement the frozen rules, including confirmation delays, entries, exits, and sizing. Review the code and compare its trades with your manual log. See Making strategies. A difference should be traced to a rule, data input, or fill assumption rather than resolved by choosing the more profitable result.

The LuxAlgo strategy viewer supports inspecting results and saving runs with their script and settings. Quant’s error-fixing assistance does not eliminate the need to review trading logic or data assumptions.

Native Drawing Demonstration

This short video shows adding a Fibonacci drawing on a native LuxAlgo chart. It illustrates selecting anchors for a measurement. Use only anchors known at your test’s decision time; the drawing itself is not a pattern-validation result.

Drawing-tool demonstration, not historical replay. Save annotations before revealing the later outcome.

Finish with an Auditable Record

Keep the rule version, period, eligible and rejected setups, screenshots, fill assumptions, costs, results, and unresolved cases together. Separate the development results from the unused evaluation period.

Revise a rule only with a documented reason, then evaluate the new version separately. Forward observation or paper testing can add evidence about timing and execution behavior, but simulated fills still have limitations. The purpose of manual backtesting is to discover how the specified process behaves, including when it fails.

Learn to trade smarter.

Market analysis and techniques that build your edge, one email a week.

Don’t worry, no spam here. See our privacy policy for more info.

Christopher Downie
Christopher Downie

Content & Product Strategist at LuxAlgo || Background in Computer Science || 7 years experience in retail CFD trading.

Read next