How Do You Turn a Trading Pattern Into a Rule You Can Test?
· #hypothesis-testing #backtesting #volume-profile #research-method #systematic-trading
A trading pattern becomes a testable rule only when every word in it has a measurement: which level, measured over what window, respected by how much and in what unit, for how long before the idea expires, and what would count as the level failing. All of it has to be decided before the data is opened. Most patterns do not survive being written down, and that is the test working.
MasterVP · Systematic Trading Journey
Written by the founder of KenKem, a software engineer of twenty years who traded gold by hand before building the research stack behind MasterVP. I am a self taught quant, and this is the step in my own process where most of my ideas die. This is knowledge sharing, not a recommendation to trade anything. Every figure below is a backtest or simulation on real tick data from my release 1.26 write up of 15 September 2026, and none of it is a live result.
Why does a pattern that looks obvious disappear when you write it down?
Because the pattern was in my attention, not in the data.
You watch price respect a value area low four times in one session. It feels obvious. The chart seems to be telling you something, and the feeling is strong enough that you start planning around it. Then you try to write it down as a rule a computer could follow without asking you, and the questions start.
Most of the time, when I finish answering them, the edge is gone. For years I took that as a defeat. Now I think it is the most useful thing the process does. A discretionary trader never has to finish the sentence, so a pattern that exists only in hindsight can live in their head forever, quietly deciding trades. Writing it down is how it gets evicted.
What questions does a rule have to answer?
Five, and each one used to be a place where I let myself off the hook.
Which level, measured over what window? A value area low from today's session, from the last week, or from a longer master profile are three different objects that happen to share a name.
Respected by how much, in what unit? Gold's volatility can triple between the Asian session and New York. A fixed distance that means "close" at 3am means "noise" at 3pm, so the unit has to scale with the market. In my own work that unit is the average true range, which is most of what the word adaptive means in my system.
For how long? An idea without an expiry never fails. It just waits.
What counts as the level failing? This one is the hardest, and it has to be written before looking. Decide it afterwards and every loss becomes an exception.
What does it cost? Which brings me to the two things I no longer skip.
Why do costs and tick data go in from the very first run?
Because both change the answer, not just the size of it.
Costs go into the hypothesis from the first test, never subtracted at the end. A scalping edge that only survives before spread and commission is not a small edge. It is not an edge. I wrote about how that arithmetic works on gold in why a gold scalp starts in the red.
The test also runs on tick history, not one minute bars. A bar tells you where price opened, closed and travelled to, but not the order it happened in, and that path inside the bar is exactly where a scalping stop lives. In the Dquants engine I developed, a C++ laboratory searches wide and MetaTrader on real ticks is the referee for final profit and loss. Where the two disagree, MetaTrader wins, and the laboratory has to reproduce it before I trust it again.
What does the auction lens add to a rule?
It gives the rule one question to answer instead of twenty.
MasterVP reads the market as an auction. Buyers and sellers spend most of their time agreeing on a range of fair prices, the value area, and the interesting moments are when price leaves it. Not every departure means anything. Some breaks carry structure and momentum. Many are price stretching to the edge of the crowd and falling back in.
Framing it that way turned a vague feeling ("gold likes this level") into a question that can be written down and scored: is price leaving value with enough evidence to matter, or only wandering? Everything else in the rule serves that question. Classic indicators are allowed to veto a trade but never to start one, which I explained with the measurements behind it in do trading indicators actually predict price.
How do you know the rule is real and not a pattern you imagined?
Build fakes that are identical in everything except the one thing the rule claims to know, and see whether the rule beats them.
For each system I built 1,000 fake versions: same market, same number of trades, same hours, same months, same balance of longs and shorts, same stop sizes, same exits. Only the moment of entry was random. If the entry rule is just a story, a good share of the fakes should match it. The pass mark was set in advance at p below 0.05, on both periods, before any result existed.
On 2024 to 2026, none of the 1,000 fakes matched the real rule, p below 0.001. On 2021 to 2023, 299 of the 1,000 did, p of 0.30. That period misses the bar, and it is published anyway. The reason is measured rather than argued: those were quiet years for gold, the rule is built to wait for real departures from value, and in a quiet market the system mostly stands aside instead of trading through. A rule that clears the bar only where its idea says it should is more believable to me than one that claims to work everywhere.
Which intuitive rules failed when I wrote them down?
Most of the ones a sales page would happily sell you.
Never giving the day's profit back cut profit and made drawdown worse. Flow based exits could not reliably tell a pullback from a reversal. Trading crypto through the weekend halved profit and doubled drawdown. A daily loss cutoff clipped the bad days and also blocked the recoveries that followed them. A hard drawdown halt was outright catastrophic. Taking profit earlier to reduce risk, the most intuitive of the lot, made drawdown worse, and not for the first time in this program. Each was written as a rule before it was tested, and each failed on my own data.
What does the graveyard say about the survivors?
That they were selected harshly, which is the only thing that gives a survivor weight.
As of release 1.26, the Dquants engine had searched 7,990 distinct configurations and I had run 169 MetaTrader referee tests on real ticks. Of 158 experiments declared in advance, with the decision rule written before the result, 140 never became a product and 3 shipped. The indicator can even mark the setups that almost formed and were filtered out, each with a short reason. It is off by default because it makes the chart busier, but I find those near misses teach the character of the system better than a row of clean wins.
A method that never rejects anything is not a method. It is a story with numbers attached.
Frequently asked questions
What makes a trading rule testable? Every term in it has a measurement fixed before the data is opened. That means the level, the window, the distance in a volatility based unit, an expiry, and a written definition of failure. A rule missing any one of these can be reinterpreted after the fact.
Why do most discretionary trading patterns fail when tested? Because many of them live in the trader's attention rather than in the data. Hindsight makes the four touches memorable and hides the sessions where the level broke. In my own process, most ideas lose their edge before the first full test finishes.
Should trading costs be added before or after a backtest? Before, from the very first run. Subtracting them later lets a cost-sensitive idea look promising for weeks. On a short-horizon gold strategy, the spread alone can decide whether an idea exists.
Why use tick data instead of one minute bars? A bar hides the order in which its high and low happened. For a strategy with a tight stop, that order decides whether the stop or the target was hit first. My referee is MetaTrader running on real ticks.
What is a random-entry permutation test? A test that builds many fake versions of a strategy identical in every way except the moment of entry. If the real rule does not beat nearly all of them, the entry is not adding anything. On 2024 to 2026, none of my 1,000 fakes matched the real rule, p below 0.001.
Is it a problem when a strategy fails the test in one period? Not if the failure matches what the rule claims about itself and it is published. My rule missed the bar on the quiet 2021 to 2023 gold market, p of 0.30, where the system mostly stands aside.
How many ideas should fail before one ships? There is no fixed ratio, but the count should be public. In my own registry, 140 of 158 pre-declared experiments did not become a product, and 3 systems shipped.
If you want to see where this process ended up, MasterVP is my own intraday method built on public volume profile theory. It ships as the Master Volume Profiler indicator on TradingView and MetaTrader 5, which shows the read and leaves the order with you, and as Master Volume Sniper on MQL5 market, an Expert Advisor that executes the rules and risk settings you configure.
This article was composed from the pattern-to-rule posts of the MasterVP build log series. Educational purpose only. Not financial advice. Figures cited are backtest and simulation results on real tick data, and past performance does not guarantee future results. Every trader remains responsible for their own risk settings and decisions.