Algorithmic trading — testing procedures and evaluating someone else’s results
A program can execute a rule faster and more accurately, but automating trading alone does not establish an edge. Changes in signals, fill prices and costs need to be checked. This lesson explains how to prepare a reproducible test, recognise data limitations and assess your own result or an algorithm provider’s report. It also shows why parameter selection and the sequence of events within a candle can determine the outcome. Every numerical example is illustrative; no test on market quotes was conducted.

Begin with the event ledger, not the final equity curve
A program’s request is not yet a position, and a cancellation request is not yet an acknowledgement that nothing else can execute. Before assessing a return chart, reconstruct one order from its records. The exercise below uses invented events for a single EUR/USD buy request. It tests bookkeeping and timing, rather than the profitability of an algorithm. Assume a hypothetical order protocol that allows a partly filled remainder to remain active until execution or confirmed cancellation.
Assume a request for 40,000 EUR. The ledger first records two fills: 12,000 EUR at 1.10420 and 18,000 EUR at 1.10430. A request to cancel the remaining amount is then sent. Before cancellation is acknowledged, a further 4,000 EUR fills at 1.10435. The final acknowledgement cancels the unexecuted remainder. All records share a synchronised UTC clock; their arrival and processing order is retained.
| Event | Additional executed EUR | Cumulative executed EUR |
|---|---|---|
| First fill | 12,000 | 12,000 |
| Second fill | 18,000 | 30,000 |
| Cancellation requested | 0 | 30,000 |
| Further fill before acknowledgement | 4,000 | 34,000 |
| Remainder cancellation acknowledged | 0 | 34,000 |
Reconcile quantity and weighted price
The executed quantity is 12,000+18,000+4,000=34,000 EUR. The cancelled remainder is 40,000−34,000=6,000 EUR. Treating the cancellation request as an instant cancellation would omit the last fill and understate exposure by 4,000 EUR. Treating every fill as a full requested quantity would make the opposite error.
The weighted entry is (12,000×1.10420+18,000×1.10430+4,000×1.10435)/34,000≈1.104270588. An unweighted average of the three prices gives equal importance to unequal amounts. Keep the original fills for calculation and round only the displayed weighted figure. MetaTrader’s documentation distinguishes orders, deals and position accounting; several deals need not mean several independent positions. This ledger is an assumed sequence, not a claim that every fill policy permits it.
A cash check can expose a state error
Suppose the whole executed amount is later sold at 1.10450 USD per EUR. The cash received is 34,000×1.10450=37,553.00 USD. The three purchases cost 37,545.20 USD in total, so the difference is 7.80 USD. With a declared total round-trip commission of 1.36 USD and no other charges, the net is 6.44 USD. Calculating from the unrounded fill amounts gives the same result as using the exact weighted entry.
The actual buy and sell prices already reflect their transaction sides; do not subtract another spread from this difference. The commission is the total for the completed exercise, not a charge to apply to every row of the ledger. A single reconciled gain says nothing about an algorithm’s expected value. It shows only that quantities, cash movements and charges agree under the stated assumptions.
Check when each input could enter the rule
Use a separate timing example. A bar covers [10:00, 10:05) UTC. Its final Close reaches the decision process at 10:05:00.050; the process finishes its calculation at 10:05:00.070 and submits a request at 10:05:00.090. A test that uses this final Close to fill at 10:04:59.999 moves information backwards in time. A realistic test needs a declared rule for order creation and later execution, not merely a final chart value.
TradingView’s strategy documentation explains its broker-emulator assumptions and default distinction between order creation and the next available fill tick. Those are simulator conventions to inspect, not a guarantee about a live broker. Keep data-arrival, decision, submission, acknowledgement and fill records separately. Also record how repeated callbacks for the same completed bar are handled: counting one event twice changes the procedure. The full lesson examines out-of-sample testing, parameter selection, ambiguous intrabar paths and monitoring after deployment.
Three exercises with worked answers
The exercise data are hypothetical. Choose an answer, then check the calculation.
From one reconciled order to a reproducible test
The original detailed lesson follows with its illustrations, sensitivity calculations and testing procedure. Use it to distinguish data assumptions, parameter selection and live execution evidence before interpreting a reported return.
1. What automation changes in execution, and what it leaves unchanged in the calculation
A program converts a specification into orders and an event record. Fidelity depends on correct code, data and a functioning environment; errors and interruptions remain possible.
Both the rule and whether its implementation executes the correct version therefore need checking. Automation provides a reproducible procedure only under those conditions.
An automated system can evaluate a condition at scheduled times, submit orders with specified parameters and keep records. Each element requires correct implementation and monitoring of the environment. Records should also include unexecuted signals and why they were skipped. These are potential execution benefits, rather than a guarantee of flawless operation.
Executing more signals need not mean more profit. The multiplication below preserves the sign only in a model with an unchanged mean net outcome per trade. It does not describe every effect of changing execution methods.
Assumptions. A rule evaluated at candle closes, one instrument and 240 entry-condition occurrences in the study period. Manual execution produced 150 trades; the remaining signals were missed because they occurred outside observation hours or no decision was made. Automatic execution produced 236 trades; four orders were rejected and recorded as unexecuted signals. Expected value per trade: two assumed versions,−0.20 and +0.20 pips; article 8.2 explains the calculation. All figures are illustrative; the result is a numerical example, not a test on data.
Calculation. Signal execution rate: manual 150÷240=62.5%, automatic 236÷240=98.3%. Transition multiplier:236÷150=1.573.
Negative version:150×(−0.20)=−30.0 pips versus 236×(−0.20)=−47.2 pips.
Positive version:150×(+0.20)=+30.0 pips versus 236×(+0.20)=+47.2 pips.
Information availability and execution. The number of condition occurrences is known only after the entire period has been processed, so this is a retrospective calculation. The manual execution rate can be obtained only from records including skipped signals; without that field it cannot be calculated. Article 8.1 identifies the field. The system’s four rejections are execution events known afterwards.
The 1.573 multiplier applies to both versions only because we assumed the same mean net outcome and comparable signal sets. A real transition to automation may change signal selection, response time and fills. Counting orders alone cannot determine the direction of the final difference.
A comparison should specify what remains common: the signal definition, available opportunities, exit rule and outcome calculation. A higher execution rate says nothing about the additional trades. If manually skipped signals have a different distribution from executed ones, multiplying the earlier mean by the new count creates an incorrect scenario.
Response prices and costs are assessed separately. A program may submit an order earlier, but may also repeat an error or act on stale data. An execution difference has economic value only in the complete version’s calculation. The example with a fixed mean isolates signal count; the next changes cost. Their conclusions are consistent because their assumptions differ.
Why manual records do not predict an automated system’s result
We do not know whether the 90 skipped signals were a random sample. Skips may depend on observation hours and additional filters, but their relationship to outcomes requires data. Records should include unexecuted signals and the reason for each omission.
Manual records describe the executed version of a rule. They need not describe a version executing every signal. A discretionary filter may improve or worsen results; the difference cannot be estimated without the omitted cases.
This is resolved by determining outcomes for all signals, including skipped ones, on historical data—the test addressed by the rest of this article. Prospective records that also include unexecuted signals, as in the calculation above, serve the same purpose. The difference is that they accumulate at the market’s pace, which cannot be accelerated, while a historical test uses material already available.
Limits to what automation contributes
The list of things automation does not do is shorter than the list of promises, but its claims can be checked.
Automation does not establish an edge. It can change average gains, losses, win rate and cost through execution timing and method. Net expectancy must be checked for the actual rule version, rather than borrowing the earlier manual version’s result.
It does not guarantee lower costs. Spreads and commissions still apply, although faster responses or appropriate exit timing may change execution. Signal-to-submission delay and order-to-fill slippage are distinct deviations; both may affect outcomes. Cost changes require measurement on comparable signals.
More trades may provide more information, although not in proportion to the number of additional rows. Positive outcome dependence can increase the mean’s error, while some forms of negative dependence can reduce it. Effective sample size belongs to a justified model; it is not automatically less than N. Article 8.2 develops the assessment.
It moves decisions earlier rather than removing them. Every decision made during manual trading must be made beforehand for automated trading—as a specification. More decisions are needed, because a program also requires answers to questions a person handles instinctively: what happens to a signal while a position is open, to a missing candle, or to a position reaching neither level? Section 3 covers these questions.
An automated system executes a specified procedure; assessment covers its logic, data and execution. Better execution can have economic value. It does not replace evidence that the complete rule remains profitable after costs outside the material used to select it.
Execution can change the sign of the net result
An illustration using the same signal logic: mean outcome before execution deviations +0.40 pips. At a manual-version cost and delay of 0.65, the net mean is −0.25; at an automatic-version figure of 0.25, it is +0.15. These values do not establish that automation usually improves results. They show why an unchanged-sign claim requires an assumption of unchanged execution.
2. Four forms of automation and the provider’s incentives
Retail participants can choose arrangements distinguished by something more important than the degree of automation: who specified the rule and who can verify it. This matters more than the distinction between “manual” and “automatic”, because it determines whether the procedure below can be applied at all.
| Arrangement | Who specifies the rule | Is the rule known? | What can be checked independently? | What determines the provider’s revenue? |
|---|---|---|---|---|
| Your own program | The user | Yes, in full | Everything on the reproducibility record: rule, data, costs and sample split | No provider |
| Semi-automation — a program evaluates the condition; the user decides and submits the order | The user | Yes, for the condition; the decision rule needs a separate specification | The signal list and signal times; the whole arrangement can be checked if the selection rule is specified | No provider |
| Copy trading — orders reproduce trades from another account | A third party | No; only executed trades are recorded | The trade history, if provided in full; the triggering condition cannot be reproduced | According to the agreement; check the remuneration components |
| A ready-made program or signal subscription | A third party | Depends on the agreement; it may not be disclosed in full | Only what the provider supplies; an undisclosed rule prevents reproducing the test | According to the agreement: subscription, turnover or performance-based payments require checking |
The provider’s remuneration model must be read from the service terms: it may depend on subscriptions, turnover or performance. The model alone establishes neither quality nor dishonesty. Assessment requires the rule, test description and data identifying what the published result represents.
Available offers may omit withdrawn programs or accounts whose results are no longer published. If so, the ranking contains survivorship selection. Establish its historical composition rather than assuming that every unsuccessful program disappears.
Your own program and conflicts without a seller
The table’s first row appears free of the final column’s problem because there is no provider. One conflict remains, however, and may be more difficult because there is no other party to identify it. The rule’s author and tester are the same person, and the test determines the fate of work they have already done.
The author should record every tested version and every use of validation data, including failures. We assign neither a frequency of omissions nor motives to authors. A record kept from the outset is simply more reliable than reconstructing the experiment history.
Semi-automation and the gap it leaves
In semi-automation, a program may evaluate the condition while a person selects orders. If the additional filter is specified and reproducible, the whole arrangement can be tested. If it remains discretionary, the result belongs to the combination of program and human decisions.
The consequence matches the manual records in section 1, and deserves clarification here because it may be less visible. The result does not belong to the programmed rule alone; it belongs to that rule combined with an unspecified selection rule. Testing the former says nothing about the combination. To assess the arrangement, the second rule must be specified. Article 8.1 gives the specification criterion: two people should interpret it identically.
The result’s status depends on what was specified and executed, rather than merely on a person’s involvement. A program with an explicit filter can form a reproducible system; an undisclosed filter limits reproducibility.
Reproducing another account’s trades
Without the rule, copy trading allows assessment of the published trade series but cannot reproduce a strategy test over another period. Dates, instruments, costs and execution differences can still be questioned. The missing rule limits assessment; it does not remove every piece of information from the record.
Execution also differs. Copying follows a signal from another account, so the order reaches the market later and volume may be rescaled. Both differences affect the copying account, rather than the original, so the published path describes something different from what the copier receives. The divergence depends on the rule: it may be insignificant with a target of tens of pips, yet exceed the entire planned gain with a target of a few pips. The cost-to-target calculation in article 8.3 shows this.
Legal issues—the service’s status, provider obligations and client protection—belong to section 13 and fall outside this text. The methodological point is that copying removes the ability to test the rule, leaving the questions in section 9.
3. The prerequisite: can the rule be reproduced on the data?
Before asking about performance, ask whether two independent reconstructions of the same specification on the same quote data produce the same trade list. If not, subsequent comparison loses its meaning: two different rules bearing the same name would be compared.
Two independent implementations strongly test unambiguity. They need not be the only check: agreed reference cases and event-by-event comparisons also help. A discrepancy may arise from a specification gap or coding error. Locate its cause rather than automatically rewriting the rule.
Checking event lists provides more information than matching final totals. Two implementations may achieve the same result through different trades, or generate identical signals with different exits because execution sequences differ. Compare times, direction, quote side, trigger basis and fill.
Agreement establishes neither an edge nor a valid execution model. It confirms consistent reproduction of a particular specification and settings. Both implementations may share an incorrect assumption. Reference cases and information-availability checks test assumptions at the individual-decision level before using aggregate results for economic assessment.
Checking agreement between two reconstructions
The procedure is straightforward and requires two executions: the same rule, quote file and period. Compare lists, rather than aggregates: entry timestamp, direction, entry price, exit timestamp, exit price and exit basis. Agreement is the share of trades appearing on both lists in the union of unique trades.
Assumptions. The same rule specification, candles and period. Reconstruction A produced 62 trades; B produced 58. There were 54 matching entry timestamps and directions. Illustrative values: a calculation showing the scale of the effect, rather than a measurement of differences between any actual programs.
Agreement calculation. Unique trades:62+58−54=66. Agreement:54÷66=0.8182=81.8%. Differences:12 of 66, or18.2%—eight appearing only in A and four only in B.
Define a common trade beforehand. The illustration uses entry time and direction, a narrower measure than full trade agreement including prices and exits. Different time tolerances or matching methods could change the 54 matches, so the matching definition is part of the method.
The 81.8% result describes the constructed lists. It does not mean the other 18.2% are proven errors in either implementation. First establish whether the cause lies in specification, data, code or execution modelling. Its effect on the mean is a separate measure and may be large or small regardless of the agreement rate, as the assumed A and B totals show.
Illustrative total for A:54×0.30+8×(−1.50)=4.20 pips, or 4.20/62=0.067742 per trade. B:54×0.30+4×2=24.20, or 24.20/58=0.417241. The ratio using unrounded means is 6.1593, or 6.16. Rounded values 0.417 and 0.068 would give approximately 6.13.
Both implementations in the illustration share the same fill model. In practice, a discrepancy may also arise from coding errors, data settings or tool versions, even with the same rule specification.
The 12 differing trades changed the mean outcome more than sixfold in this set. That follows from the assumed outcomes, rather than being a universal property of disputed trades. Matching entry time and direction is insufficient: also compare exits, prices and their basis.
Where discrepancies arise
The following cases require explicit specifications or implementation checks. No frequencies are assigned to them. A clear specification removes some differences; others require checking data and execution models.
- Window boundaries. Does the candle being evaluated belong to the reference-level window? In a 20-candle window, changing one candle may change the level depending on its formula—from no change to a multiple of the planned target.
- Strict or non-strict inequality. Does “price above the level” include equality? With finite decimal precision, equality occurs more often than intuition suggests because prices are rounded to a quote increment.
- A signal while a position is open. Is it skipped, does it increase the position, or replace it? Those three answers produce three trade lists from the same signal stream.
- A signal on the candle in which a position closes. Did the position close before the signal was evaluated? The answer depends on a sequence the candle does not contain.
- Missing data. Is the condition evaluated when a candle is missing from the window? Filling the gap with a neighbouring value and skipping evaluation produce different lists; either may be chosen without recognising it as a choice.
- Candle identification and clock changes. Are candles identified by source-local timestamps or universal time? During the repeated hour after a clock change, the former convention creates duplicate labels; without an explicit offset, local labels can repeat. Check the identification rule.
- An unresolved position. Is there a time exit, and does its counter use existing candles or clock hours? A weekend makes these answers produce different closing dates.
- The test period’s end. What happens to a position open on the last candle? Closing at the last price, omitting the entire trade and leaving it open produce three different totals.
Assign each discrepancy to specification, code, data or execution modelling. Clarify a specification gap in writing; repair an implementation error in the program. Then repeat the comparison using reference cases and the complete event list.
Separate two issues often combined in practice. Making a rule objective—converting a chart observation into a calculable condition—is an analytical technique covered by article 5.12. Checking whether two independent programs reproduce that specification identically is methodological and belongs here. The former asks “can it be calculated?”, the latter “will it always be calculated the same way?”
A closing-based rule and the response price
A condition using a candle’s close becomes available only afterwards. A fill cannot precede signal availability and a realistic response. The next quote may equal the close; price equality alone does not prove look-ahead.
The error occurs when the test uses information unavailable at the assigned decision time. Recording a closing price after signal availability is not inherently an error; check availability, submission and execution timestamps and the simulator’s rule.
A look-ahead example: an exit level at time t uses a candle’s high or low that will arise only after t. Using the current candle is not always wrong—its data so far may already be available. The check concerns when a specific value became known, rather than the candle’s label alone.
Establish each value’s availability time. A value learned at candle close can trigger an order only after becoming available to the strategy. A subsequent fill may equal the close, but the candle alone cannot establish that. Missing timing information limits interpretation and must be disclosed and investigated.
4. Data, quote side and intrabar conventions
A test is a function of three things: rule, data and cost model. The previous section covered the first. This section addresses the others, beginning with a point often omitted in testing material: data are not a single universal record. One instrument over one period has as many records as sources, and their differences exceed rounding.
What must be known about the data
A quote dataset is described by characteristics that cannot be inferred from one another.
Source and version. A record comes from a particular provider and may be revised afterwards—gaps filled and incorrect quotes corrected. Tests before and after correction are different tests. Reproducibility requires recording the download date as well as the source’s name.
Quote side. The record may contain Bid, Ask, both or their midpoint. Section 2 explains the distinction; its arithmetic effect in testing appears below.
OHLC does not contain the sequence within a candle. A complete tick record gives the sequence of recorded changes at its timestamp resolution, but guarantees neither completeness nor fills. Time resolution, quote side and gaps must be known; they are distinct data characteristics.
Completeness. Missing time units, duplicate timestamps and source outages change the evaluation opportunities. Gap handling must be specified; otherwise the tool’s default behaviour decides it.
Changes in the instrument universe. For a multi-instrument test, establish whether the instrument set remained constant throughout. An instrument whose quotes are withdrawn disappears together with its result—the same mechanism affecting the offers in section 2.
Quote side: the arithmetic effect
A rule may be calculated on one side while orders execute on the other. A long position opens at the Ask offered to the participant and closes at the Bid; the difference is paid once per completed round trip. If the simulation enters and exits on the same side, the entire difference disappears from the calculation.
With a constant spread and a frozen trade list, the omitted component grows linearly with trade count. Actual spreads may vary and affect activation and subsequent orders. The example below isolates a fixed arithmetic adjustment; it is not a complete Ask/Bid simulation.
Intrabar conventions: where the data are silent
OHLC does not specify whether the high or low occurred first. When both exits are reached after entry within one candle, the result may depend on the unknown path. Even when only one level is reached, questions about entry time, quote side and fill availability may remain.
Assuming TP before SL or SL before TP is a model convention. TradingView, for example, describes O–H–L–C and O–L–H–C paths selected according to the opening price’s position.[6] Finer data can reduce ambiguity, but do not automatically establish execution availability at every touched level.
Assumptions. A30-pip target and 20-pip protective exit, both measured from a common reference price before costs. Candle data on one quote side, yielding 400 closed trades. In 46 cases, one candle’s range covered both levels. The 354 resolvable trades totalled +180 pips. The simulation omitted a 0.80-pip spread per trade by booking both entry and exit on the same side. All figures are illustrative; this is a numerical example, not a test result.
Unresolved share.46÷400=11.5%.
Optimistic version.180+46×30=180+1380=+1560 pips;1560÷400=+3.90 pips per trade.
Conservative version.180−46×20=180−920=−740 pips;−740÷400=−1.85 pips per trade.
Range.46×(30+20)÷400=2300÷400=5.75 pips per trade. This entire amount comes from the convention rather than the data.
After adding the omitted spread. Every closed trade incurs the cost:354×0.80=283.2 pips for resolvable trades;400×0.80=320 pips overall. The resolvable total falls from +180 to 180−283.2=−103.2 pips. Optimistic:1560−320=+1240 pips, or+3.10 pips per trade. Conservative:−740−320=−1060 pips, or−2.65 pips.
The example identifies 46 trades depending on the two assumed sequences. The other 354 were treated as resolvable within this model. In a real test, higher resolution may also reveal entry-timing and fill errors outside that group.
Result and interpretation. Eleven and a half per cent of trades reverse the overall sign. An undisclosed intrabar convention therefore omits decisive, rather than secondary, information. Qualifications: both levels were assumed fully executable in every disputed candle, excluding touches without execution availability. Slippage was also omitted; in the conservative version it would increase losses.
Scroll the diagram horizontally or open it at full size.
Report disputed trades’ effect on both total and mean alongside their share. A small share can have a large effect when outcomes are large. The two paths provide useful bounds only within the specified level and fill model; they are not general bounds on actual outcomes.
Check price-side clarity and sequence after the entry condition. A candle covering both levels before entry need not create the same issue as one covering them afterwards. The specification should distinguish these situations rather than automatically treating every such candle as disputed.
Sequence sensitivity can be calculated for assumed levels and fills, but unknown liquidity or partial execution may create further outcomes. “Optimistic” and “conservative” therefore refer to a specific convention. Reporting both is more informative than hiding one choice, but does not guarantee an actual trade would fall between them.
Cost modelling in simulation
Record spread, commission and slippage separately. A model using one reference price must add cost explicitly. For actual Ask/Bid fill differences, the spread and slippage already embedded in prices are included and must not be deducted again. Simulated slippage may be estimated from a separate empirical sample; the backtest itself does not measure new fills.
Fixed-slippage and distribution-based models may differ. The distribution can depend on exit type and market conditions. Assign no direction or magnitude of asymmetry without data; compare explicit scenarios and available empirical executions.
Rejections and partial fills can be simulated. Omitting them does not always bias results in one direction: a rejected order might have won or lost. Label their absence as a model limitation rather than proof that the result is always overstated.
For positions spanning rollover, financing totals Σ rⱼdⱼ. Here rⱼ is the rate at that time and dⱼ the accrual weight. Omitting a negative swap overstates the result; omitting a positive swap understates it. Articles 8.5 and 8.6 explain the weights.
Do not multiply today’s rate by a night count and apply it retrospectively to the entire history. Accrual-event weights, contemporaneous rates and units are required. Variable volume also requires the calculation basis for each segment. A missing rate history must be labelled as a limitation or replaced with an explicitly named cost scenario.
Omitted swaps can bias comparisons between two horizons in different directions. Positive accrual is revenue improving the balance under the assumed conditions, rather than a renamed cost. Negative accrual lowers it. Neither sign follows automatically from position direction. Transfer the calculation method from articles 8.5–8.6, rather than their illustrative rates.
If the rule suspends trading around events, reproduce that filter using the historical calendar and time zone. Without the filter, results include both conditions. A mean may describe the mixture, but its composition and separate costs should be disclosed. Article 8.8 covers release windows;8.4 defines the trading day’s end.
A release filter requires information available before the decision, rather than later commentary identifying which events proved important. Specify the list, release time in the relevant zone and treatment of schedule revisions. If the rule has no filter, do not subsequently remove unfavourable trades around releases and call the remainder an unchanged test.
Changing the day boundary is methodologically similar: it can change signals and data assignment. Preserve the source convention and clock offsets instead of fitting them to results. The mixed sample’s mean remains a valid description of that mixture, but can hide performance concentration without subperiods and cost conditions.
A demo test checks signals and execution in a demonstration environment. Its results can be analysed, but do not establish identical cost distributions on a live account. Shadow testing sends no orders and measures no fills. Label these modes explicitly.
One candle, two admissible outcomes
An illustrative long position was already open at Ask 1.10000. The stop triggers at Bid 1.09800, the target at Bid 1.10300. The next Bid candle: O=1.09992; H=1.10320; L=1.09780; C=1.10040. Both paths match this OHLC: O–H–L–C reaches the target first; O–L–H–C reaches the stop first.
With modelled full fills at the levels, price outcomes are +30 and −20 pips. After 0.20 commission, they are +29.80 and −20.20. The spread is already included between the actual entry Ask and exit Bid, so is not deducted again. OHLC establishes neither sequence nor execution at touched levels.
Both drawn paths visit the same O, H, L and C in different orders. This suffices to demonstrate ambiguity, although it does not exhaust every OHLC-consistent path. Outcomes are measured from the assumed entry Ask to exit Bid. The Bid candle has no Ask history and cannot reconstruct the whole spread history by itself.
The +29.80 and −20.20 figures are calculations of two modelled full fills, rather than observed execution. Simulator documentation defines the convention; finer data may establish quote sequence. Actual fills would require order and execution records. Report these three layers—path, convention and execution—separately.
5. From a rule to deployment, with progression criteria
Rule-testing stages are often presented as a task list. A list alone decides nothing because it gives no condition for progressing. Below, each stage has a question requiring an affirmative answer for the next to make sense, plus the action for a negative answer. The sequence is not arbitrary: each stage assumes completion of its predecessor.
Scroll the diagram horizontally or open it at full size.
What happens after a negative answer
Disagreeing lists halt result interpretation until the cause is established. After repairing data, code or specification, repeat both runs. Do not select a list simply because its result is better.
Stage two. Missing any of the five data characteristics halts the test because each affects results. Supplying them is organisational work, rather than substantive research, and usually takes less time than arguing about whether it is necessary.
Results on selection data describe the fitted version and provide no independent confirmation. They can diagnose issues and reject an idea under pre-specified criteria. A negative result need not end every project, but a revised version is a new decision requiring independent assessment. Report the share and effect of unresolved intrabar cases even with a positive mean.
Walk-forward selects parameters on an earlier window and evaluates them on the next. The available Pardo chapter excerpt describes this construction.[1] Results lie outside each local selection window, but choosing window lengths and the whole procedure after inspecting every result can still fit the evaluation. Record the decision history and, after such revisions, use a new untouched final test.
Testing on incoming data can be shadow, demo or live. Shadow compares data availability and signals; demo also includes demonstration fills. Actual slippage, rejections and partial executions require records of live orders. Every mode additionally supplies prospective information about rule behaviour, rather than execution alone.
Stage six. A shutdown criterion written after deployment is commentary on the outcome, rather than a criterion. Section 10 explains its construction and statistical properties. Here the formal requirement is sufficient: it must exist before the first order.
Monitoring compares the same measure in the same units, allowing for sample size and period. An outcome in account currency and one in pips are not directly comparable. No claim about this error’s prevalence or priority is made without studying reports.
The shutdown criterion is part of the procedure. Its activation is not certain within every finite period. Revising it after inspecting results requires recording a new version and checking it separately.
How much history each stage uses
Behind this sequence of tasks lies consumption of one finite resource: available quote history. Seeing the allocation numerically is useful because it may be the sole reason the procedure cannot be performed in its planned form.
Assumptions.60 months of available history. Rolling windows with 12-month parameter-selection periods and 3-month evaluation periods, advancing every 3 months. The rule averages 4 closed trades monthly. All figures are illustrative; this is an organisational calculation, not a test.
Evaluation-window count. The first covers months 13–15, the last 58–60. Count:(58−13)÷3+1=16.
History evaluated.16×3=48 months, or 48÷60=80.0% of all history. The first 12 months are never evaluated because they serve solely to select parameters for the first window.
Trade count. Evaluated:48×4=192. In one parameter-selection window:12×4=48.
Information availability and execution. Fix and record the split before the first run, since it determines every reported number’s status. Changing either window length after seeing results is another use of validation data, subject to section 6.
Result and interpretation. Compare two counts. The 192 trades evaluated outside training data are the entire assessment sample. This count—not history length in years—enters the uncertainty calculation in article 8.2 and the shutdown criterion in section 10. The 48 trades in each selection window are the whole basis for choosing parameter values: six values mean selecting one of six from 48 observations. Qualifications: four monthly trades is assumed; actual counts change across windows with conditions. Low-count windows offer less reliable selection yet have the same share of the total time.
A longer training window provides more data but may include more distant market conditions; it does not guarantee better selection. Conclusions depend on uncertainty, effect size and change over time. A few dozen trades alone do not establish that a test contains no information.
Data status and execution mode
In-sample denotes material used for construction or selection. OOS denotes material not used for that decision; walk-forward is a particular procedure of successive local OOS evaluations. Forward means data arriving after the version is fixed, with shadow, demo or live execution. A live result is actually incurred on an account. These labels describe separate axes and can combine; forward does not automatically mean live fills.
Status always refers to a particular decision. One period can be OOS for an earlier version and selection material for the next if its first result prompts a revision. Forward describes chronological order, so prospective observations can also select a later version.
Execution mode answers a separate question. Shadow observes data and signals without orders; demo supplies demonstration fills; a live account supplies actual fills. These are not levels of one classification. A report can therefore identify the prospective period, its role relative to the version and execution mode simultaneously. Each resolves a different interpretive uncertainty.
Report data role and execution mode separately. Without them, a number’s meaning is limited: it might describe version selection, independent evaluation, future signals or an actually incurred result. These are not four mutually exclusive categories.
Scroll the diagram horizontally or open it at full size.
Forward testing: which events do you actually observe?
| Prospective mode | Observed facts | What it does not establish |
|---|---|---|
| Shadow — no orders | Data and signal availability, hypothetical orders | Actual fills and execution costs |
| Demo | Signals, orders and demonstration fills | Identical live execution |
| Live | Actual orders, fills, costs and rejections | Persistence of the edge beyond the observed period |
Every report identifies dates, the frozen rule version and changes during the period. Forward describes chronological testing; “live” describes execution. They are not interchangeable labels.
6. A catalogue of testing pitfalls
Pitfalls limit test reliability in different ways. Some specific errors, such as look-ahead in a known implementation, can be removed and verified by rerunning it. No guarantee for the future does not mean that every detected error can only be partially mitigated.
| Pitfall | Mechanism | Check | Limitation |
|---|---|---|---|
| Look-ahead | A value became available after the assigned decision time | Availability records and event checks; rerun after correction | Unreconstructed data versions may leave a limitation |
| Historical-value revisions | The test uses a later revision instead of the value available then | Preserve historical versions and check availability | Disclose a missing original version |
| Survivorship | The universe includes only instruments or rules still available | Reconstruct historical composition and changes | Without history, removed outcomes cannot be estimated |
| Selection by performance | Choosing the best of many trials may include a chance excess | Version records and independent assessment of the whole procedure | No guarantee against noise; selection alone does not prove an artefact |
| Overfitting | Fitting sample-specific details instead of a property that transfers beyond it | OOS assessment of the frozen procedure and sensitivity checks | The neighbourhood may also be selected after seeing results |
| Period dependence | Performance concentrates in particular conditions | Disjoint subperiods and a description of performance concentration | Short histories may exclude other conditions |
| Dependent trades | Ignoring dependence may understate the mean’s error | An explicit cluster model or block-based checks | Time splits do not remove every cross-instrument dependence |
| Incomplete costs | Omitted or inappropriate costs and execution events | Complete price basis, scenarios and fill records | The effect of rejections depends on the omitted trades |
| Intrabar conventions | OHLC does not establish which exit level came first | The share and outcome range of disputed cases; finer data | A price touch does not establish a fill |
| Mixing statuses | Selection-data performance is presented as validation | Each period’s role, version and execution mode | An IS+OOS total can be descriptive but is not independent OOS |
Reviewing many versions increases the chance of selecting a randomly favourable result. A maximum alone does not prove an artefact; allow for the family of tested rules and selection procedure. White describes a test comparing the best performance with a benchmark while controlling data snooping.[2]
Harvey, Liu and Zhu analyse multiple tested relationships in research on the cross-section of expected returns.[4] Their significance thresholds are not transferred to a retail FX test. This source points to a separate literature on multiple testing.
Why repeated use consumes a validation window
OOS ceases to be independent validation for new decisions if its result was used to revise the rule or procedure. Rereading alone does not change the data, but acting on that reading changes their role.
Once revisions use OOS results, that period becomes part of selecting the new version. Bailey and co-authors describe overfitting probability within a particular selection procedure.[3] This does not establish that every selection invalidates all information about the future.
A used window cannot become unseen again. The entire procedure can, however, be frozen and assessed on new untouched data or through a separate outer split. Usage records identify the version for which a result was still OOS.
The table’s scope
The rows describe various test limitations, rather than overstatement alone. Some omissions can act in either direction. Contract specifications require a separate check: if the rule cannot be executed under those restrictions, a favourable test does not resolve that problem. Section 11 develops these conditions.
Park and Irwin’s review surveys studies of technical-analysis profitability.[5] It is not used here to assign a share of false results or claim most rules fail. Explicit model calculations establish the limitations in this lesson, rather than unverified generalisations about the literature.
A new test after changing the rule using OOS data
Version v 1 was selected without period B, making B OOS for that decision. Reading B led to a parameter change and v 2. B now serves selection of v 2: it can still document an error but no longer independently confirms v 2. The frozen v 2 needs period C, unused for parameters, window lengths or costs. The report retains v 1, v 2, decision dates and each period’s role.
7. Sensitivity testing: cost, parameter and period
An edge claim requires checking whether performance survives reasonable assumption changes. Three axes are essential because every test contains three types of assumptions: cost, the key parameter’s value and the selected period. All three are examined on one numerical set below so they can be compared.
The rule has one free parameter: the window length used to calculate a reference level. Tested values are 10.15.20.25.30 and 40 candles. The measure is mean outcome per closed trade in pips after a 0.60-pip cost. Versions A and B differ in entry-condition construction. Every figure in this section is illustrative, comes from no actual test and serves solely to show how to interpret such a set.
The tables use assumed means and counts without processing quotes. There is therefore no empirical disputed-candle share, fill record or IS/OOS status. These fields are not applicable—no test conducted, rather than 0%. A real report must provide them alongside data and models.
No test conducted does not mean zero errors. Disputed candles, rejections and look-ahead cases are unknown because no such event list exists. Zero would be a result of a specified check on a complete sample. “Not applicable”, with its reason, accurately describes the illustration’s construction.
An actual comparison would require quote source and version, signal definition, costs, periods’ roles and an event list reproducing the means. Resembling a test report does not confer that status. These values are inputs to sensitivity calculations; validation checks arithmetic rather than A or B’s empirical quality.
The parameter axis
| Window length | Version A — trades | Version A — mean outcome | Version B — trades | Version B — mean outcome |
|---|---|---|---|---|
| 10 candles | 320 | +0.05 pips | 300 | +0.18 pips |
| 15 candles | 250 | +0.42 pips | 240 | +0.44 pips |
| 20 candles | 210 | +1.73 pips | 200 | +0.51 pips |
| 25 candles | 180 | +0.38 pips | 175 | +0.49 pips |
| 30 candles | 160 | +0.31 pips | 155 | +0.46 pips |
| 40 candles | 130 | +0.22 pips | 125 | +0.29 pips |
Both versions peak at 20 candles. Selecting the larger number alone would favour A. Neighbourhood and subperiod checks show greater sensitivity for A in this set, but do not establish an edge for B.
Ratios from full weighted means are 1.733333/0.400028=4.3330 for A and 0.509750/0.463442=1.0999 for B. Tables display rounded values. The neighbourhood mean uses the two full means rather than rounded rows.
A has an isolated peak; B a broader area of similar results. This diagnoses sensitivity rather than proving A is an artefact or B a stable strategy. Neighbouring means also come from the same sample, often sharing trades; they do not replace new OOS data.
The chart preserves a numerical parameter axis:30 to 40 is wider than earlier adjacent intervals. The drawn area’s width therefore corresponds to window lengths rather than an arbitrary column count. Point heights use full weighted means instead of copied rounded rows.
A broader positive area usefully describes this sample’s sensitivity. It does not provide many independent confirmations because neighbouring rules may use the same trades. The area itself can also be selected after seeing results; its selection history then needs the same scrutiny as a single peak. Chart geometry cannot replace data splits and uncertainty assessment.
Scroll the diagram horizontally or open it at full size.
Trade count falls with window length, but uncertainty also depends on dispersion and dependence. A smaller-N row can still provide useful information. Without distributions, no confidence intervals or certainty of selection are assigned here.
The cost axis
With a fixed trade list and uniform extra cost ΔC, the mean falls by exactly ΔC. A rule without a cost filter does not guarantee an unchanged list: variable spreads can alter activation, while fills or rejections can change positions and subsequent signals. A full test must resimulate these events.
Shifting every mean is useful only with a frozen list and equal extra cost per outcome. It quickly reveals a margin but does not reconstruct changed strategy behaviour. If extra cost depends on time of day, exit type or holding period, calculate it for the appropriate events.
Spread changes can also violate the fixed-list assumption. For a short position, the Ask may trigger a stop earlier; that closure changes later signals allowed by a one-position rule. Cost then becomes part of the decision sequence rather than a deduction from the final total. Full execution stress requires an explicit rerun.
| Cost per trade | A — peak (window 20) | A — peak neighbourhood | B — peak (window 20) | B — peak neighbourhood |
|---|---|---|---|---|
| 0.60 pips (assumed in the test) | +1.73 | +0.40 | +0.51 | +0.463442 |
| 0.90 pips | +1.43 | +0.10 | +0.21 | +0.163442 |
| 1.20 pips | +1.13 | −0.20 | −0.09 | −0.136558 |
The extra 0.60 pips is illustrative stress, rather than a measured typical difference between simulation and trading. With a frozen list it makes both neighbourhood means negative. A credible stress range in a real report requires data or justified execution conditions.
B has low sensitivity to neighbouring parameters in this set but greater cost sensitivity. After justified additional costs, a positive peak alone is insufficient to establish an edge. Full assessment also requires uncertainty and data outside selection.
The period axis
The third axis repeats the entire parameter review separately in two disjoint subperiods.
A changing best parameter indicates period dependence. It may reflect noise, changing conditions or justified adaptation. The maximum’s movement alone cannot distinguish them.
| Window length | A — subperiod I | A — subperiod II | B — subperiod I | B — subperiod II |
|---|---|---|---|---|
| 10 candles | +0.20 (170 trades) | −0.12 (150) | +0.25 (160) | +0.10 (140) |
| 15 candles | +0.95 (130) | −0.15 (120) | +0.52 (125) | +0.35 (115) |
| 20 candles | +3.20 (110) | +0.12 (100) | +0.60 (105) | +0.41 (95) |
| 25 candles | +0.60 (95) | +0.13 (85) | +0.55 (92) | +0.42 (83) |
| 30 candles | +0.42 (85) | +0.19 (75) | +0.50 (82) | +0.41 (73) |
| 40 candles | +0.15 (70) | +0.30 (60) | +0.33 (66) | +0.24 (59) |
Weight means by trade count. At 20, A:(110×3.20+100×0.12)/210=1.733333. B:(105×0.60+95×0.41)/200=0.509750, rounded to 0.51. Exact means for all six settings underlie neighbourhood and cost-stress calculations.
A’s maximum moves from 20 candles in the first subperiod to 40 in the second. At setting 20, the first contributes 110×3.20=352 pips and the second 100×0.12=12; the first accounts for 96.7% of the 364 total. B’s maximum moves from 20 to 25 and every mean stays positive. The 0.01 difference between two settings is a feature of constructed numbers; its significance cannot be determined without outcome dispersion.
A is parameter- and period-sensitive in this set; B gives similar neighbouring results. Both weaken with higher costs. There is no empirical sample, outcome variance or selection test, so neither is assigned a lasting edge.
Using sensitivity-test results
The parameter axis describes the neighbourhood; cost describes the margin for a particular surcharge; period describes historical performance concentration. None identifies a figure that can be transferred into the future without further checks.
When all three assessments point the same way, the conclusion is straightforward. When they differ, there is no deciding rule, and pretending otherwise is unhelpful. One statement is nevertheless clear: a result reversing sign after a small, realistic change in one assumption is unstable, regardless of its initial height.
A flat neighbourhood can still share the same sample
The 15-,20- and 25-candle versions may share many trades. Similar means then do not provide three independent confirmations. Before concluding robustness, check shared events, subperiod results and the whole area’s selection history. The neighbourhood mean describes this sample; it is not new OOS evidence.
8. The reproducibility record
A test is reproducible when someone with its description alone can obtain the same result. The criterion is strict, with no intermediate degrees: the description either suffices or does not. The record below lists items whose absence interrupts reproduction and identifies what then becomes unknown.
| Item | Required contents | What remains unknown without it |
|---|---|---|
| Rule | A complete decidable specification, including the section 3 edge cases: signals with an open position, unresolved exits, missing data and period end | The trade list—and thus everything, since all subsequent numbers derive from it |
| Instrument and period | Symbol, start/end dates, instrument count and, for multiple instruments, the universe at each point | Whether results come from one historical segment and whether the universe was defined retrospectively |
| Data source and version | Provider, download date and corrections applied afterwards | Whether reproducing the test on a later download uses the same quotes |
| Quote side | The quote side used for the condition and execution accounting, separately for entry and exit | Whether the spread is included or entirely omitted |
| Resolution | Candles with their time unit, or individual price-change records | Whether the event sequence within the unit was known or assumed |
| Intrabar convention | The convention when one time unit’s range covers both exits, and the share of such cases | How much performance comes from data versus convention—the section 4 calculation |
| Cost model | Spread, commission converted to the test’s units and slippage, separately; identify each as fixed, read from data or randomly drawn | Whether performance is gross or net, and its change after a realistic cost increase |
| Missing-data handling | Treatment of missing time units, duplicate timestamps and recording interruptions | Whether both reconstructions share the same condition-evaluation opportunities |
| Sample split | Parameter-selection data, evaluation data, validation-window use count and number of tested versions | Result status—without this item, training-data performance cannot be distinguished from performance outside it |
| Trade count and time distribution | Total count, subperiod counts and clustering information | How many independent observations the trades represent, and therefore estimation uncertainty |
| Procedure or code | A step-by-step reproducible specification with tool versions | Whether reconstruction differences arise from the rule or its execution |
| Result status | The data role and execution mode for every figure in section 5 | What the figure actually means |
The record documents data, rule and execution method. Completion time and the prevalence of omissions in other reports are not assigned without research. Tool versions, file checksums and decision lists establish whether the same experiment is being compared.
An equity curve can show the outcome path and concentration if its axes and basis are specified. It does not replace rule, data, costs or selection history. The chart alone cannot reproduce a test or assess every limitation, although it is not devoid of information.
What to freeze to reproduce a result
Alongside the record, retain SHA-256 hashes of data and code, tool versions, parameters, time zone and UTC offsets, random seed if applicable, and event list. Source-verification dates identify which model documentation was checked. After data or tool changes, compare the trade list with the previous manifest, rather than only the final total.
A checksum detects changes to file bytes; it does not assess data quality or code correctness. Identical files may share an error. The manifest identifies what was used so an independent person can investigate it and repeat the corrected run on a named version.
A random component also requires the generator’s parameters, sampling method and usage sequence. The seed alone may not suffice after library or model changes. Tool versions and event records distinguish a changed random stream from a changed rule. This is information for interpreting results, rather than an environment-configuration tutorial.
9. Evaluating someone else’s results through questions
Someone else’s result is assessed like your own, with one difference: missing information cannot be supplied independently, so an unanswered question ends that assessment rather than becoming a stage within it.
Separate the two lists before the first question; otherwise the comparison grows too long to finish. Eight questions about the result itself—trade count, period and instruments, costs, data splits, tested-version count, maximum drawdown, concentration in the largest trades and who bears the risk—belong to article 8.2, section 13. They apply unchanged to algorithmic results and are not repeated here. The list below covers only what is added when a figure comes from a historical quote test rather than executed trades. Each row follows the same order: question, required answer and the meaning of its absence.
| Question | What the answer must contain | What its absence means |
|---|---|---|
| Which data and quote side? | Provider, download date, quote side for the condition and execution accounting | Whether the spread is included is unknown; omitting a fixed spread has a per-trade effect that sums linearly |
| What resolution and intrabar convention? | The recorded time unit, sequence convention and share of cases it determined | Results may come from a convention rather than data; section 4 calculates the effect’s scale |
| How were recording gaps handled? | Treatment of missing time units, duplicate timestamps and quote interruptions, with their counts | It is unknown whether reconstructions share condition-evaluation opportunities; changing that list changes trades and every subsequent figure |
| Is each cost component fixed, read from data or randomly drawn? | Separately for spread, commission and slippage: fixed value, observed data or sampling distribution and parameters | Cost components already appear in 8.2’s list; the added point is that each form is reproduced differently, and random sampling without a specified seed differs on every run. The entire cost axis in section 7 also becomes unavailable |
| How were trades distributed through time? | Subperiod counts and clustering; total count already belongs to 8.2’s list | Effective independent-observation count, uncertainty and whether results concentrate in one segment beside empty subperiods cannot be estimated |
| How often was the validation window used? | Evaluation count on data not used for parameter selection, and whether any reading prompted a rule change | Data splitting already appears in 8.2’s list; the additional issue is consumption of validation data. A reading used for revision becomes selection material for the new version, making its “out-of-sample” label empty even though a formal split remains |
| What happens when the parameter moves one step? | Neighbouring values, rather than the maximum alone | Sensitivity to neighbouring parameters is unknown |
| How is the worst path defined? | The measure’s operational definition and source period/sample; drawdown magnitude already belongs to 8.2’s list | Two definitions produce two numbers for one path, so comparing figures without definitions compares different quantities; section 9 explains risk measures and construction |
| Are there results on incoming data, and over how long? | Start date, trade count and whether the rule changed during the period | Only historical performance remains; execution status needs a separate description |
| How was the test conducted? | Procedure or code reproducing events step by step, with tool versions | A reconstruction discrepancy cannot be assigned to rule or execution—different conclusions requiring different actions |
| Does the publisher run the same specification with their own funds? | Whether the supplied rule version matches the one on the publisher’s account, and what determines their revenue | Who bears the risk already appears in 8.2’s list; the added issue is version separation. An algorithm can be supplied in a different version from the one used, unlike a series of manually executed trades. Without this distinction, incentives to verify before supplying it cannot be assessed—section 2 |
The last question may be considered impolite and is the only one not about testing procedure itself. It clarifies whether the other ten questions address someone who has borne the consequences of their own findings or someone affected solely by other people’s findings. This accuses neither party; it identifies where the burden of verification lies.
How the two lists work together
Their practical order matters. Start with the eight questions in article 8.2: they are shorter and more often settle the matter. Without trade count, dates or data split, recording resolution is irrelevant because what it would describe is unknown. A result passing that list requires the eleven questions above, which determine whether the figure describes the rule or the procedure that tested it.
Live-order reports contain actual fills but still require algorithm version, signal source and rule changes. Intrabar questions concern simulation; data quality and signal availability matter in live execution too. Historical cost models may be estimated from a separate execution sample.
Execution resolves uncertainty about that fill’s price, but not why the program submitted the order. Contemporaneously available data, rule version and signal records remain necessary. Source outages or incorrect candle boundaries can occur in live trading even when a fill is correctly recorded.
A simulation may use slippage estimated from earlier live fills. That sample has its own dates, instruments and limitations. It neither measures new backtest fills nor guarantees transfer of the distribution to the next period. Preserve each component’s provenance instead of treating the whole test as opposed to every form of actual data.
What may be supplied instead of answers
Other material may replace answers, although none is equivalent. First, an equity curve contains neither rule, cost model nor sample split. Second, period length without trade count: two years can mean 20 or 2000 trades, so the same time span need not provide a comparable number of observations. Both quantities belong to article 8.2’s list, yet one may substitute for the other. Third, a single aggregate quality figure without sample, period, costs or data split is a function of those missing quantities rather than the rule alone.
An accurate performance record may have limited value for judging the future. Distinguish data truthfulness from test independence, cost scope and selection history. Selection by performance alone does not prove an artefact, but requires selection-aware validation.
Applying the same questions to your own result
Your report should retain decision dates, including readings without rule changes. Retrospective reconstruction is less reliable than a contemporaneous record, but no predetermined direction of memory error should be assigned.
A split recorded before testing establishes planned data usage. Reconstruction may describe the split actually used, but does not prove it remained unchanged after seeing results. Version and decision histories are required.
10. Monitoring and a pre-specified shutdown criterion
After deployment, observe whether rule behaviour matches the tested version’s scope. Differences may reflect random dispersion, changing conditions or data/execution failures. A performance criterion cannot identify the cause perfectly, but its alarm frequency and delay can be assessed in explicit models.
A criterion based on exceeding the test’s worst observation
One construction raises an alarm when an individual outcome is worse than the test minimum. Its properties are calculated below for a specified model, with no claim that this construction is common.
Assumptions. Shut down the algorithm when one observation is worse than the test period’s worst observation. An observation is one closed trade’s result. The test contains N trades; the post-deployment period M trades. The distribution remains entirely unchanged and observations are exchangeable—every ordering is equally likely. It is also continuous, so equal-valued observations do not occur. Illustrative values: a probability calculation under stated assumptions, not a test result.
Calculation. Activation occurs exactly when the worst observation in all N+M falls after deployment. Exchangeability makes each of the N+M observations equally likely to be worst, so P=M/(N+M).
N=200 and M=100: P=100÷300=33.3%.
N=200 and M=200: P=200÷400=50.0%.
N=600 and M=100: P=100÷700=14.3%.
For every finite M, this probability is below 1. It approaches 1 as M grows without bound in this model. It guarantees no alarm within a specified time; exchangeability and continuity are important assumptions.
M/(N+M) concerns the minimum of individual outcomes under exchangeability without ties. It is not even a ready approximation for exceeding maximum drawdown, which depends on the path and requires a separate model. Alarm frequency may differ outside these assumptions.
Exchangeability means the joint distribution is symmetric under reordering. Equal means alone do not suffice for this calculation. Time dependence or a distribution change can alter the minimum’s location probability. No ties ensure a unique worst observation; tied values require an explicit alarm rule.
Maximum drawdown is not the minimum individual result. It arises from cumulative paths and can change when outcomes are reordered, even with an identical trade set. Therefore this formula cannot turn sample counts into drawdown-alarm frequency. The model here demonstrates the problem of a short reference period for individual losses.
Scroll the diagram horizontally or open it at full size.
The calculation has design implications. Such a criterion must be related to period length rather than its threshold alone: “worse than the test’s worst” differs after 100 and 1000 trades. The second implication concerns stage four in the procedure: a longer test reduces false-alarm sensitivity, another reason not to shorten that stage.
A criterion based on no trades
The second construction addresses the opposite situation: the rule generates no signals although it should. This warning concerns whether the rule encounters the conditions it was designed for, rather than performance.
Assumptions. The tested rule averaged one trade per 21 sessions. Signal occurrences are assumed independent and uniform in time: interval counts follow a Poisson distribution with mean equal to interval length divided by 21. Illustrative values.
Calculation. The probability of no signal for g sessions is e^(−g/21).
g=40: e^(−1.905)=14.9%.
g=60: e^(−2.857)=5.7%.
g=90: e^(−4.286)=1.4%.
A gap with 5% probability lasts−ln(0.05)×21=2.996×21=62.9 sessions; at 1%,−ln(0.01)×21=4.605×21=96.7 sessions.
Information availability and execution. One trade per 21 sessions comes from the test and is known before deployment, allowing a pre-specified criterion. The current gap’s length is known as it develops, requiring no post-trade quantity.
For one pre-selected 40-session window, the Poisson probability of no signal is 14.9%. This is not the frequency of the longest gap over years of monitoring. Clustering and variable intensity may change results in either direction; without a model, these percentages are not labelled lower bounds.
What a written shutdown criterion should contain
A performance criterion should state measure, unit, threshold, observation length, required sample and post-alarm action. Separate integrity failures, such as duplicate orders or missing required data, may require immediate suspension without waiting for a minimum trade count.
A threshold without an observation period is incomplete: one outcome, a recent-window mean and the historical minimum are different quantities. Window length and required N determine which events trigger alarms. Multiple checks require accounting for frequency and dependence; one check’s percentage does not automatically describe all monitoring.
Post-alarm action must also be specified. Suspension, diagnosis and restart require the cause and monitored version. A revision using the alarm period cannot retain the old independent-test status. Integrity failures remain distinct: detecting them need not await statistical evaluation of the mean.
Restart conditions should be reproducible: identify the alarm’s cause, repair it, and assess the new version on unused data and in a specified forward mode. The period prompting revision serves diagnosis rather than new independent OOS validation.
Why such criteria can err in both directions
A sensitive criterion shuts down a functioning rule, as the first calculation shows. An insensitive one leaves a rule operating after conditions change, for as long as it takes to collect a deciding sample. Both sides of this trade-off arise because one outcome series is compatible with many distributions, and distinguishing them requires observations that take time to accumulate. Article 8.2 covers the sample needed to detect a specified difference.
A performance criterion chooses a balance between frequent alarms and delayed reactions. Its properties can be assessed in explicit models and prospectively. Results cannot identify a regime with certainty, but useful diagnosis remains possible.
More checks increase the chance of an alarm
In a homogeneous Poisson model, one pre-selected 60-session gap has no-signal probability q=exp(−60/21)=5.74%. For 12 disjoint windows, independent under this model, the chance of at least one empty window is 1−(1−q)¹²=50.82%. This does not model rolling, overlapping windows. One check’s threshold cannot be called an annual false-alarm rate without recalculation.
The 12 disjoint windows define a particular set of checks. Poisson counts in them are independent, allowing multiplication of the probabilities of no empty window and subtraction from 1. That assumption belongs to the formula, rather than every observed strategy.
Rolling checks share many sessions. Their outcomes are dependent and may flag a long gap repeatedly. Their frequency needs a different calculation or explicit simulation of the whole procedure. Estimating intensity from a short sample adds uncertainty too. The illustration treats one trade per 21 sessions as a given parameter, rather than a measured edge.
11. What this article does not establish
The procedure has a defined scope, worth setting out because each limitation below changes the conclusions it supports.
Completing the procedure does not establish an edge
The procedure supplies evidence about the tested version under specified data and costs. It guarantees no lasting edge. Good OOS performance with uncertainty assessment may support one; selection and testing establish neither success nor artefact in advance.
This distinction is practical rather than philosophical. “The rule completed the procedure” can be checked and stated. “The rule has an edge” additionally requires full-cost expectancy and uncertainty estimates on data outside rule construction. That belongs to article 8.2, rather than this text.
Every numerical value here is assumed
No test was conducted. The 240 signals,400 trades,46 disputed cases, six parameter values across two versions and 21 sessions between signals illustrate calculations and scale only. Your own inputs would change every result, sometimes its sign. Treating any of these figures as an estimate would contradict its stated status.
Finding a rule worth testing
Ideas and signal construction belong to section 5 and article 8.7. A test may provide diagnosis useful for the next hypothesis, but cannot guarantee a better idea. Every revision using test results extends the selection history.
Execution is an input here, rather than the subject
Slippage, rejections and partial fills enter the cost model as numbers requiring a source. Their source concerns trading conditions and comparisons, covered by section 11. The program’s environment, configuration and technical requirements belong to section 12. Neither topic is described here or can be inferred from the preceding material.
Position size and portfolio-risk measures remain outside the calculation
Pip outcomes are volume-independent within the assumed linear cost model. Minimum fees and different fill conditions may violate that. Position sizing and equity-path measures belong to section 9.
Behaviour after shutdown belongs to another section
Shutdown criteria were discussed as procedural elements with modelled properties. Define them before deployment and record later changes. Human reactions to adverse results belong to section 10.
12. Self-check exercise and the next step
The exercise repeats three calculations with different inputs and identifies omissions in someone else’s report. The dataset and worked solution follow.
Part one—intrabar conventions.300 closed trades, with a 25-pip target and 25-pip protective exit measured from a common reference price before costs. In 39 trades, one candle covered both levels. The 261 resolvable trades total −60 pips. Entry and exit were simulated on the same quote side, omitting a 0.50-pip spread. Illustrative values.
- Calculate the unresolved share.
- Calculate total and per-trade mean for optimistic and conservative versions.
- Calculate their per-trade range.
- Correct both for the omitted spread.
Part two—sensitivity. A parameter review peaked at +1.10 pips per trade; immediate neighbours were +0.24 and +0.16 pips.
- Calculate the peak-to-neighbourhood-mean ratio and describe sensitivity; geometry alone establishes no lasting stability.
- Check the peak and neighbourhood after adding 0.45 pips to cost.
Part three—shutdown criterion. The test contained 150 trades. Shut down when one trade is worse than the test’s worst.
- Calculate activation probability within 150 post-deployment trades under an unchanged distribution.
- Repeat with 450 test trades instead of 150.
Part four—someone else’s result. A claim reads: “System on one currency pair, two years of hourly data, positive performance, tested out of sample.” Identify missing reproducibility-record items.
1. Unresolved share.39÷300=0.130=13.0%.
2. Two versions. Optimistic:−60+39×25=−60+975=+915 pips, or 915÷300=+3.05 pips per trade. Conservative:−60−39×25=−60−975=−1035 pips, or −1035÷300=−3.45 pips.
3. Range.39×(25+25)÷300=1950÷300=6.50 pips per trade. Check:3.05−(−3.45)=6.50. The sign depends solely on convention rather than data;13% of trades decide the whole result.
4. Spread correction.300×0.50=150 pips overall;261×0.50=130.5 pips for resolvable trades. Optimistic:915−150=765 pips, or+2.55 pips. Conservative:−1035−150=−1185 pips, or−3.95 pips. The resolvable total falls from −60 to−190.5 pips, so excluding disputed cases the rule loses under both assumptions.
5. Neighbourhood mean 0.20; peak ratio 1.10/0.20=5.50. One-step declines are 78.2% and 85.5%. The peak is sensitive in this set. The 0.20 mean does not become confirmed expectancy; it still comes from the same sample.
6. Adding 0.45 makes the peak +0.65 and neighbourhood mean −0.25 pips. This shows cost and parameter sensitivity here. It does not establish an artefact or a specified persistence probability for the positive peak.
7. With N=M=150, exchangeability without ties gives P=150/300=50%. This is the probability of at least one new minimum up to that observation count, rather than a guaranteed alarm on a particular trade.
8. A longer test. P=150÷(450+150)=150÷600=25.0%. Tripling test length halved false-activation probability without changing rule or criterion.
9. Omissions in the report. It touches three items but completes one. Instrument and period are fragmentary: no symbol or dates; “two years” does not replace a range. Resolution is supplied—the only complete item. “Tested out of sample” declares status, but without the sample split it cannot be verified and does not complete that item.
Nine other items are missing: full rule, data source/version, quote side, intrabar convention/disputed share, itemised cost model, gap handling, sample split/validation-use count/tested-version count, trade count/time distribution, and reproducible procedure. With hourly data and two exit levels, an absent intrabar convention alone can prevent interpretation, as part three’s calculation shows: its sign depended entirely on that convention.
Check. Conservative outcomes are lower in both calculations. Both range calculations agree. Alarm probability falls with a longer test. Trade totals are expressed in pips and means in pips per trade; conversion to account currency was not performed and would require pip value.
Applying the procedure next
Document rule, data and model first. Then check implementation agreement and calculate. No assumption is made that this takes an hour or that a particular number of omissions appears in most reports.
Diagnose intrabar cases’ share and effect, parameter neighbourhood and cost sensitivity. The first needs simulation events; the second additional parameter settings; full cost stress may require resimulation. Not all information comes from one run.
A separate question outside this article often decides feasibility first: can this work method fit your available hours and circumstances? Automation changes less than it may seem, moving the burden from market observation to construction and supervision rather than removing it. Section 10’s monitoring remains regular work. Article 8.10, the section’s final lesson, eliminates methods infeasible under personal constraints.
Follow the out-of-sample checklist in Strategy Testing Protocol, stress-test drawdown sequences in the Monte Carlo Simulator, and audit trade logs with the Journal Analyzer.
FAQ — frequently asked questions
Does automation improve performance?
It can change response time, omissions, fills and costs, thereby changing net performance. Section 1’s 1.573 multiplier preserves the sign only with an unchanged mean per trade. Automation alone establishes no positive edge and guarantees no improvement.
Does a historical backtest prove that a rule works?
Historical testing can serve selection, diagnosis or OOS validation depending on the data’s role. A result alone guarantees no persistence. Report rule, information availability, costs, intrabar convention and selection history. The 46 disputed trades out of 400 show how missing sequence information can change the entire mean’s sign.
How can historical parameter fitting be checked?
Check neighbouring parameters, subperiods, costs and selection history. A flat area is useful sensitivity diagnosis but may also result from same-sample selection. An isolated peak alone proves no artefact. Independent validation and outcome uncertainty are needed.
What should be asked before using someone else’s algorithm or copying trades?
Two sets of questions are needed. Article 8.2, section 13 supplies eight about the result: trade count, period/instruments, costs, data splits, tested-version count, drawdown, largest-trade concentration and who bears risk. They apply equally to algorithms and manual decisions. Section 9 adds eleven about testing: data source/quote side, resolution/intrabar convention, gap handling, each cost component’s form, time distribution, validation-window uses, one-step parameter sensitivity, worst-path definition, incoming-data duration, procedure/tool versions, and whether the publisher uses the same rule with their own funds. Copying without a disclosed rule removes reproduction; only the performance record remains, which is not a test.
When should an algorithm be shut down?
When its specified criterion is met. Performance alarms require threshold, period, sample and action. Data failures or duplicate orders are separate suspension grounds without waiting for a sample. The minimum model M/(N+M) concerns only individual outcomes under exchangeability without ties.
Why do two programs based on one description differ?
The cause may lie in ambiguous specification, coding errors, data or execution settings. Compare events and locate the first difference. Repair specification gaps in writing and errors in implementation, then rerun. The illustrative 18.2% list difference produced a more-than-sixfold mean difference, not a universal ratio.
Sources and references
- The Evaluation and Optimization of Trading Strategies — Chapter 1 excerpt. Describes walk-forward construction; proves none of this lesson’s outcomes. Verification scope: the available 12-page chapter 1 excerpt and publisher metadata, rather than the whole book. Access checked:2026-10-05.
- A Reality Check for Data Snooping. The abstract describes model-selection risk after repeated data use and a benchmark test. Verification scope: abstract and article metadata in an academic PDF copy, rather than all 30 pages. Access checked:2026-10-05.
- The Probability of Backtest Overfitting. An overfitting-probability procedure; selection alone does not establish an artefact. Verification scope: abstract and definition excerpts in the authors’ PDF; no claim to reading all 34 pages. Access checked:2026-10-05.
- …and the Cross-Section of Expected Returns. The abstract describes multiple testing in expected-return cross-sections; numerical thresholds were not transferred to FX. Verification scope: page 1 abstract in the author’s PDF and publication metadata, rather than all 64 pages. Access checked:2026-10-05.
- What Do We Know About the Profitability of Technical Analysis?. Review bibliography; not used to claim most results are false. Verification scope: bibliographic metadata on the author’s website; no full reading of the article. Access checked:2026-10-05.
- TradingView Pine Script — Strategies: Broker emulator. Two OHLC-path conventions, broker-model and intrabar-data limitations. Verification scope: the documentation’s Broker emulator and Bar Magnifier sections. Access checked:2026-10-05.
- Bank for International Settlements (BIS): Markets Committee: FX execution algorithms and market functioning (2020).
- CFTC: Supervisory and operational guidance on automated trading risk controls.