ValidationIntermediate23 min read

Removing a filter changes more than a backtest

Design a trading strategy ablation that separates component effects, changing trade samples, capital constraints and policy changes, with worked examples.

An opened mechanical watch with one brass gear carefully set aside on a workbench
Conceptual image: removing a part can change how the whole mechanism behaves.

The better curve that answered a different question

A researcher removes a volatility filter from a Forex robot and sees a higher final balance. The obvious story is that the filter was unnecessary. Yet the new version entered twice as often, occupied the account during different hours and prevented another robot from opening positions. Its average holding period changed too. The screen contains two curves, but the experiment contains several simultaneous changes. Without separating them, the researcher cannot tell whether the result says anything useful about the filter itself.

An ablation is an investigation in which a component is removed, disabled or replaced to understand its contribution. The word does not guarantee a clean comparison. In a trading system, a component can decide whether an opportunity exists, how much capital it receives, when an order is submitted or which later opportunities become unavailable. Removing it can alter the entire path of the system, including decisions that occur long after the component first acts.

This article follows an invented robot called Cedar. All prices, counts and monetary outcomes below are hypothetical teaching examples, not results from TradeAndRoll systems. Cedar buys a defined breakout, closes according to a fixed exit rule and normally requires a volatility condition. Its researcher wants to know whether that condition earns its place. The useful answer might be yes, no or unresolved. It might also be that the original question was too vague to answer with one comparison.

We will distinguish a diagnostic comparison on common opportunities from a comparison of complete executable policies. We will also see why both can be useful without pretending they are interchangeable. The point is to make the experiment produce a decision: retain a component, investigate its interaction with another component, simplify the implementation or collect information that the current trade log cannot provide.

Write the intervention as a sentence someone can check

Start with the exact change. “Remove the volatility filter” sounds precise until another person implements it. Does removal mean that every candidate entry becomes eligible? Does it mean replacing the observed volatility with a fixed value? Does the filter also control position size? If the same variable contributes to both eligibility and sizing, deleting its calculation can unintentionally alter two decisions. A readable intervention names the branch being changed and the branches that must remain identical.

For Cedar, the sentence is: replace the entry condition volatility_ok with true, while preserving the breakout definition, decision timestamps, exit rule, nominal exposure per accepted entry, trading calendar and cost assumptions. This is a specification for research, not code to connect to a broker. It lets a reviewer inspect the proposed intervention before seeing which curve looks better. Any implementation that also changes the exit window fails that specification even if the outcome is attractive.

Next name the outcome and the unit of comparison. The researcher might want the difference in net profit per eligible opportunity, the difference in account return over a fixed calendar or the difference in maximum concurrent exposure. Those questions can point in different directions. A filter may raise profit per accepted trade while lowering total profit, or reduce profit while removing a concentration of losses that the owner cannot tolerate.

The intervention says what changes; the estimand says what you want to learn. An estimand is simply the quantity the study is trying to estimate. Writing it in ordinary language usually exposes a hidden ambiguity faster than choosing a statistical test. Cedar’s first estimand is the change in net account profit over the same six-month calendar under the same exposure cap. A separate diagnostic asks how the filter divides the original opportunity set.

There is one more boundary: the experiment describes the historical data and assumptions supplied to it. It does not randomly assign market conditions, and it does not prove that the filter causes future profitability. The language of intervention is useful for organizing a software experiment, but it should not be expanded into a causal claim about how markets will reward that intervention.

Build the opportunity ledger before the accepted-trade ledger

A conventional trade export starts when a position opens. That is often too late for an ablation. To understand an entry filter, Cedar needs a ledger of candidate decisions before the filter is applied. Each record contains a stable event identifier, decision time, instrument, direction, reference price, the information available at that time, filter value and the reason an entry was accepted or rejected. A rejected candidate is still part of the research population.

The ledger should distinguish a signal rejection from an execution rejection. A candidate may fail the volatility condition, pass it but encounter the exposure cap, or produce an order that is not filled under the execution assumptions. If all three disappear into a single “no trade” label, the researcher will attribute effects to the wrong stage. A filter that changes the timing of requests may change fill outcomes even when its direct eligibility effect is small.

Stable identifiers matter because timestamps alone can collide. Two instruments may produce events at the same instant, and a single robot may evaluate two directions at one decision time. An identifier constructed from the strategy version, instrument, decision timestamp and decision sequence can identify the intended event without depending on the position of a row in a file. The exact construction is a software choice; the research requirement is that matching survives sorting and joins.

Consider an opportunity stamped at 10:00 whose filter input arrives at 10:00:02. If Cedar decides at 10:00:01, that input is unavailable for that decision. The ablation must not improve the unfiltered version by retaining unavailable inputs elsewhere in its logic. Information availability remains a constraint in every version. Removing one condition is not permission to repair the historical record with knowledge that only appeared later.

A common opportunity ledger separates signal filtering, capacity decisions and simulated fills
Keep rejected opportunities and their reasons. The trade log alone cannot explain which stage changed the sample.

Four groups reveal what the two policies actually share

Match the two runs to the common opportunity ledger. Some opportunities are traded by both versions, some only by the filtered version, some only by the unfiltered version, and some by neither. The third group is expected when a filter is removed. The second can initially look impossible. It becomes possible as soon as accepting an earlier opportunity changes capacity, cooldowns or the state that controls a later decision.

Suppose Cedar has 100 candidate events. In an invented unconstrained diagnostic, 60 pass the filter and 40 fail it. The passing group earns 600 dollars after assumed costs; the failing group would earn minus 200 dollars if separately simulated with the same per-entry nominal. The filtered policy therefore earns 600 dollars, while the unconstrained unfiltered policy earns 400 dollars. The difference is minus 200 dollars, exactly the contribution of the added group in this deliberately simple setting.

This accounting identity does not require the groups to have the same number of observations. It requires the simulation of shared events to remain the same and the added events not to alter anything else. Once those conditions fail, the identity needs additional terms. An unchanged event identifier may now correspond to a different position size, fill price or exit because the account took a different path. Matching labels does not guarantee matching economic treatment.

The researcher should retain the common-event comparison and the whole-policy comparison as separate views. The common-event view asks what happened to opportunities both versions could express under the diagnostic setup. The policy view asks what the complete versions did under their constraints. Neither view replaces the other. Common events can reveal a hidden implementation change; full policies reveal whether the simplification is usable in the intended environment.

Do not discard the nonmatching trades just to make the comparison look tidy. Their appearance is evidence about the intervention. Deleting them changes the question to one about the intersection of two selected samples. That intersection can be useful, but it is no longer the full effect of removing the filter.

A worked decomposition with capacity held explicit

Now impose a single-position limit on Cedar. At 09:00 an opportunity fails the volatility filter but is accepted by the unfiltered version. It occupies the only position slot until 12:00. At 10:00 a second opportunity passes the filter. The filtered version accepts it and earns 80 dollars; the unfiltered version rejects it because the slot is occupied. The earlier unfiltered trade earns 20 dollars. Removing the filter has added a trade and displaced another one.

On these two events, the filtered version earns 80 dollars and the unfiltered version earns 20 dollars. The policy difference is minus 60 dollars. Calling the newly admitted opportunity profitable is correct but insufficient: its 20-dollar gain came with an 80-dollar opportunity cost in this scenario. The relevant comparison is not the added trade against zero. It is the changed schedule of trades against the schedule it replaced.

A useful decomposition labels three contributions: outcomes from shared opportunities, outcomes from newly admitted opportunities and outcomes from displaced opportunities. For longer paths, a fourth label records changes to the economics of shared events, such as a different size caused by a changed equity balance. These labels are accounting explanations, not independent causal effects. Their sum must reconcile to the policy-level difference under a clearly stated attribution convention.

The convention becomes important when several earlier decisions compete to explain one displaced trade. Suppose two added positions together exhaust a portfolio cap. Assigning the entire displacement to the first, the second or half to each changes the narrative but not the account result. Avoid false precision by reporting the shared constraint and the affected event rather than claiming a unique causal share that the experiment cannot identify.

An added nine o'clock position occupies the only slot and displaces a ten o'clock opportunity
Hypothetical capacity example: the added trade earns 20 dollars, but the displaced trade would earn 80 dollars. The policy difference is minus 60 dollars.

Two legitimate experiments, two different conclusions

A frozen-opportunity diagnostic can simulate each candidate in isolation using fixed sizing and a fixed exit definition. It deliberately ignores interactions between accepted trades to examine how a condition divides a population of potential decisions. This is useful for understanding whether rejected events have distinctive costs, holding periods or loss patterns. It is not necessarily a tradable portfolio because isolated opportunities may overlap beyond any feasible capital limit.

A stateful policy replay carries account state forward. Positions consume capacity, exits release it, cooldowns change eligibility and capital rules react to the account path. This is the relevant experiment when the research question concerns a complete strategy or portfolio. It is also harder to interpret because one early difference can propagate into many later differences. That difficulty is a property of the system, not a reason to hide its constraints.

Cedar can use both. First, the frozen diagnostic shows that rejected opportunities have positive gross results but unusually high transaction costs. Second, the stateful replay shows that many of those opportunities arrive before the stronger opportunities and consume capacity. Together, the two findings suggest that the filter may protect both execution quality and access to later opportunities. They do not prove that its existing threshold is optimal, and they do not justify searching for a better threshold on the same evaluation period.

If the diagnostic improves and the policy deteriorates, the disagreement is informative. It points toward a scheduling, exposure or state interaction. If both improve, the researcher still checks whether costs, data availability and sample selection were held constant. Agreement between two views narrows the list of explanations; it is not a substitute for checking them. Different experiments should have different names in the report, even when their charts happen to look similar.

Retuning after removal is a second intervention

Suppose the researcher removes Cedar’s volatility filter, then changes the breakout window until the new version resembles the original trade frequency. The resulting comparison can be useful, but it is not a pure removal experiment. The new policy contains a compensating optimization. Its performance reflects the removed filter, the changed window and the selection process used to choose that window. The report must describe all three.

This distinction is especially important when comparing a simpler model with a complex one. An untuned reduced version can be unfairly weak because its remaining parameters were chosen in the presence of the removed component. Conversely, an extensively retuned reduced version can be unfairly advantaged if it receives many more search attempts. There is no universal rule that all ablations must freeze everything or that all must retune. The rule is to match the experiment to the stated question.

For a local contribution question, freeze the remaining settings and document the intervention. For an architecture comparison, allow each architecture a predeclared, comparable development budget and evaluate the selected procedures on data reserved for that comparison. These are different estimands. A local ablation may show that a component helps a particular configuration, while an architecture study shows that a different configuration without the component can perform similarly.

NIST’s discussion of one-factor-at-a-time experiments highlights that changing factors separately can miss interactions. That narrow methodological point is relevant here; it does not certify any trading design or result. NIST: one variable at a time. In Cedar, the volatility filter and the breakout window may be complementary. Removing either from a configuration built around both is not the same experiment as redesigning the strategy without either.

“The component is useful here” and “every good system needs it” are different claims. An honest ablation can support the first within its tested conditions while leaving the second completely unanswered.

Interactions deserve a small, explicit design

Imagine two optional components: volatility filter V and session filter S. A small factorial diagnostic has four configurations: neither, V only, S only and both. Use the same opportunity definitions, data and accounting conventions. In an invented example their net outcomes are 100, 140, 130 and 220 dollars respectively. The gain from V is 40 dollars without S but 90 dollars with S. The effect of V depends on whether S is present.

The arithmetic interaction is 220 minus 140 minus 130 plus 100, which equals 50 dollars. This number is an explanatory contrast within the invented design. It is not a probability, a significance test or a universal measure of synergy. It tells the researcher that the combined result cannot be reconstructed by simply adding the two isolated improvements to the baseline. The next step is to inspect which opportunities and constraints create the difference.

A four-cell design is manageable. Ten optional components create far more possible configurations, and inspecting all combinations can become a large selection exercise. The researcher should choose a limited set of scientifically or operationally motivated interactions before looking at outcomes. A dependency graph can help: if one component supplies an input to another, their interaction has an implementation reason to be investigated. Searching every pair because a computer can do it does not provide that reason.

The design must also preserve meaningful configurations. Removing a normalizer while keeping a threshold expressed in normalized units can create nonsense rather than a useful ablation. Replace the missing component with a defined alternative or acknowledge that the remaining architecture has no coherent interpretation. An executable program is not automatically a valid experimental condition. It may run perfectly while answering a question nobody intended to ask.

Four hypothetical configurations earn 100, 140, 130 and 220 dollars, revealing a 50-dollar interaction
The component's contribution depends on the other component. The four values are an invented accounting example, not measured strategy returns.

Costs and exposure can reverse the apparent lesson

A filter often changes when the robot trades. That changes the costs sampled by the strategy even if the market’s unconditional average spread stays the same. Suppose the admitted group has an average gross result of 5 dollars and a cost of 2 dollars, while the newly admitted group has a gross result of 6 dollars and a cost of 7 dollars. Looking at gross outcomes would favor the added opportunities; looking at net outcomes reveals a loss of 1 dollar per added opportunity.

Do not repair this by charging both groups the same average cost unless equal costs are explicitly the counterfactual being studied. That experiment isolates one mechanism, but it no longer estimates the policy outcome under the original execution assumptions. A useful report can show both fixed-cost and condition-dependent views, labelled clearly. The difference between them tells the researcher how much the conclusion relies on execution conditions rather than the price signal alone.

Exposure needs the same care. If an unfiltered version holds twice as much gross notional, higher profit may reflect more exposure rather than a better allocation of opportunities. Report account outcomes with the same permitted resources, then add descriptive exposure measures such as average gross exposure, peak exposure and time in market. A normalized diagnostic can be informative, but rescaling after seeing the worst historical drawdown introduces an additional retrospective choice.

Keep the resource budget visible when comparing complete policies. The budget may be capital, gross notional, number of simultaneous positions or an explicitly defined risk constraint. Each budget implies a different feasible set. A filter that helps under a one-position cap may be irrelevant under an unconstrained diagnostic. Neither statement is contradictory once the constraint is part of the name of the experiment.

Repetition, uncertainty and the temptation to declare a winner

A long trade list does not automatically provide many independent observations. Cedar’s entries may cluster around the same breakout episode, and several accepted trades may share the same adverse move. Treating every row as an independent replication can make a small historical difference appear far more precise than it is. The relevant uncertainty analysis must preserve the dependence that matters to the comparison, often by working with paired calendar outcomes rather than unrelated lists of trades.

Even a well-matched comparison remains conditional on its sample. A few market episodes can dominate the intervention effect. Inspect contributions by predeclared calendar blocks and by economically meaningful conditions, while retaining the complete aggregate result. Do not remove an inconvenient month merely because it makes the difference unstable. Instability is part of the answer and may show that the component’s role depends on conditions the current sample barely covers.

Multiple ablations create another problem. If the researcher removes twenty components, tries several substitutes and reports only the improvement, the selected result has passed through a search. NIST’s treatment of multiple comparisons explains why predeclared contrasts and simultaneous inference differ from a collection of unadjusted individual claims. NIST: multiple comparisons. The practical response is to retain the experiment inventory and distinguish exploration from a later evaluation of a fixed proposal.

The language of the conclusion should match that inventory. “Removing V improved the historical result under this fixed specification” is narrower than “V harms performance.” “The sign changed across blocks” is more useful than averaging the blocks until uncertainty disappears. Ablations can eliminate explanations without identifying one final explanation. That is still progress when it directs the next investigation toward a concrete interaction or measurement problem.

Make an AI review the experiment, not choose the story

An AI assistant can help inspect the specification, compare event ledgers and identify changes outside the intended intervention. Give it the written policy definitions and a small, understandable sample before asking for a large summary. Ask it to list fields that should be invariant, explain unmatched event identifiers and distinguish a signal rejection from a capacity rejection. These requests produce claims that can be checked against records rather than persuasive interpretations of a chart.

A useful prompt is: “Compare these two opportunity ledgers by stable event identifier. Report changed eligibility, changed size, changed fill assumptions and changed exit state separately. Reconcile their monetary contributions to the account-level difference. Do not infer the result of rejected opportunities unless a defined counterfactual simulation is provided.” This is a research prompt, not permission to run an account. The human still checks joins, units, missing records and the meaning of the counterfactual.

Be suspicious of a generated explanation that says a filter “removes noise” without defining a measurable consequence. Noise is not an observable label attached to losing trades. Ask instead whether the removed events have different cost distributions, time exposure, concentration or sensitivity to an explicit assumption. If the assistant cannot connect the explanation to fields in the ledger, treat it as a hypothesis for inspection rather than a finding.

The assistant should also challenge the report’s strongest sentence. What alternative explanation survives the evidence? Was a parameter retuned? Did the exposure cap change? Were shared trades repriced? Could one event cluster dominate the difference? A short adversarial review of the conclusion is often more useful than another decorative chart. The purpose of assistance is to make the comparison inspectable, not to turn an unresolved experiment into a confident sales claim.

Use negative controls to expose accidental changes

A negative control is a deliberately uninformative or unchanged condition that helps reveal whether the comparison machinery itself is producing an apparent effect. For Cedar, begin with a version in which the volatility filter is evaluated and logged but its output is passed through exactly as before. This refactoring should produce the same eligible events and the same accounting result. If it does not, the investigation has found a technical difference before it has learned anything about the filter’s economic role.

A second control replaces the filter with a condition that is always true in a dataset where the original filter already passes every opportunity. The two versions should agree under the declared semantics. This is a useful small fixture because it removes the question of which opportunities ought to be different. A discrepancy can then be traced to initialization, missing-value handling, order of evaluation or a shared state variable. These controls do not establish profitability. They establish that the experiment can express an unchanged policy without accidentally changing it.

A third control concerns the accounting reconciliation. Copy the original opportunity ledger, reorder its rows and reconstruct the same diagnostic summary using stable identifiers. The totals should remain unchanged when order has no declared economic meaning in that diagnostic. Do not apply this requirement blindly to a stateful replay: there, chronological order is part of the strategy. An invariance is valid only when the specification says the transformation is irrelevant. A test that ignores that boundary can reject correct software or approve an incorrect simplification.

Now consider a placebo filter. Suppose the researcher creates a random eligibility flag that admits approximately the same number of opportunities as Cedar’s real filter. Comparing the real filter against such a placebo may help distinguish a condition’s information from the generic effect of trading less. However, the placebo must preserve the constraints relevant to that question. Randomly removing individual opportunities does not necessarily preserve their clustering, time in market or relationship with exposure limits. A placebo is another experimental policy, not a universal neutral benchmark.

Use a predeclared collection of placebo realizations and retain all of them. Choosing the weakest placebo after seeing results would make the real filter look better through selection. The purpose is to understand a mechanism, not manufacture an easy opponent. If the real filter and the placebos behave similarly, the researcher has not proved that the filter contains no information; the chosen comparison may lack precision or may fail to represent the structure the filter uses. The appropriate conclusion identifies that uncertainty rather than replacing it with a binary verdict.

A practical review sheet can record each control, its expected invariance, the observed discrepancy and the explanation. For a deterministic fixture, the expectation may be exact equality. For a stochastic diagnostic, it may concern a distributional property rather than identical results. Set numerical tolerances from units and calculation precision, not from the size of the discrepancy after it appears. A difference of one cent can matter in a fixed accounting fixture even when it would be irrelevant to the strategy’s economics.

Three controls separate unchanged policy, stable accounting and a frequency-matched placebo
Controls answer different questions. Passing them makes the comparison easier to trust technically; it does not establish a trading advantage.

The deliverable is a decision record

Finish with an experiment packet that another person can reconstruct. It contains the original and modified policy definitions, data identities, information-availability rules, opportunity ledger, constraint settings, cost assumptions, matched-event summary and account-level reconciliation. Include the versions that failed or produced ambiguous results. A packet that preserves only the winning curve cannot show whether the intervention was specified before the outcome or selected because of it.

For Cedar, the decision might be to retain the filter temporarily because the unfiltered policy consumes scarce capacity before stronger opportunities arrive. That is a specific operational explanation, not a claim that the filter predicts every profitable trade. Alternatively, the decision might be to remove it because the simpler version behaves similarly across the tested conditions and is easier to inspect. Simplicity can be a legitimate benefit, but its value should be stated separately from an unproven performance improvement.

Before moving on, write the condition that would change the decision. Perhaps a future evaluation with a larger opportunity sample shows that the cost effect disappears, or an explicitly different capacity policy changes the displacement mechanism. This makes the conclusion revisable without making it arbitrary. The researcher knows what evidence would matter and does not have to reinterpret every new losing trade as a verdict on the component.

If you want to practise this approach, begin with a system whose rules and source code you can inspect. Identify one condition, write the intervention and construct a small opportunity ledger before comparing returns. The TradeAndRoll demo provides materials for that kind of investigation. For the surrounding questions, continue with parameter robustness and independent checks of AI-generated code. A useful ablation ends with a clearer decision, not merely a different curve.

Back to the Blog