Home › Documentation › Market study
Validation NEW

🎲 AQ Market Shuffle shuffled data: edge or luck?

Open it from Market → AQ Market Shuffle (edge or luck?)…. It creates a copy of one of your markets with the same bars in a different order: the same volatility, the same shocks, but no trends, no streaks and nothing that can be predicted. Run the same search on it as on the real market and you will know what luck finds. Your results must be clearly above it.

The problem it solves

When you test millions of combinations, some will look great by pure chance. AniQuant's filters (Walk-Forward, PBO, survival, Genesis Confidence) reduce that risk, but they do not remove it: they look at the same data the search used. The only way to know how much luck gives in your market, with your search and your settings, is to measure it: give the search a market where, by construction, there is nothing to find.

In science this is called a control group: the same experiment, with everything the same except the thing you want to measure.

What it does, exactly

1 · Keeps every bar

Each bar keeps its shape: where it opened, how far it rose, how far it fell and where it closed, relative to the previous close. Its volume too. That is why the volatility is identical to the real one.

2 · Shuffles them

It puts them in a random order. Trends, streaks, cycles and the habit of one volatile day bringing another all disappear. What happened yesterday no longer says anything about today.

3 · Removes the trend

It subtracts the average rise: the series ends where it starts. Otherwise «always buy» would win with the market's rise, and that would not be the search's luck. It is optional, and ticked by default.

The calendar (dates and times) is the real market's, and the new market inherits its point value, tick, commission and slippage. To every module it is just another market: it shows up in every symbol selector. It takes less than a second, even with a hundred thousand bars.

How to use it, step by step

1

Choose the real market and the period. Use the same period as the search you will compare against: that way both markets have the same bars and the same in-sample/out-of-sample split.

2

Name it and press «Create shuffled market». By default it takes the original name followed by _AZAR (@ES_AZAR). The window shows both markets overlaid and four measures confirming the shuffled one is what it should be.

3

Run the same search on both. The same module (Genesis, Laboratory, Edge Scanner, Pattern Miner…), the same settings, the same seed if the module has one and the same time. If you search one for 30 minutes and the other for 5, luck loses and the comparison flatters you.

4

Compare, above all out of sample. Whatever turns up in the shuffled market is what luck gives. If yours is not clearly above it, you have not found an edge: you have found luck. The Dispersion chart of each search shows at a glance how its results are spread.

What happened when we tried it

We ran Genesis for half an hour on the real daily @ES and half an hour on its shuffled version (seed 2026), with the same settings: long only, 70 % in sample, $3 commission and one tick of slippage. About 17 million backtests on each.

ShuffledReal @ES
Sealed strategies100100
Confidence (median)85.587.5
PBO / Walk-Forward (medians)0.24 / 91.60.24 / 91.9
In-sample net (median)$91,052$58,911
Out of sample: profitable62 of 10099 of 100
Out of sample: Profit Factor (median)1.051.65
The lesson

In sample, luck sealed the same hundred strategies with almost the same scores, and with more profit than the real market. The filters could not tell them apart. Only the stretch the search had never seen separated them: there luck stayed at a coin toss (PF 1.05) and the real market held up. That is why this control is read out of sample: a high in-sample score proves nothing while luck can score it too.

How it is built, under the hood

The bars are not shuffled with their absolute prices: that would put a 2008 bar at 1,300 points next to a 2024 bar at 5,000, with huge artificial jumps between them. Instead, a new series is rebuilt keeping the shape of each candle as a percentage change:

1

Each bar becomes four numbers relative to the previous close, as logarithms: where it opened, its high, its low and its close. The opening gap is part of the bar, so it travels with it. No artificial jumps appear: the gaps you see are the market's real gaps, in a different order.

2

Those shapes are shuffled with a reproducible seed (mulberry32 generator and Fisher-Yates shuffle): the same seed always gives the same series, bar for bar.

3

The series is rebuilt by chaining: each bar starts from the previous one's close. The close is chained without rounding, so no error builds up, and the stored prices are rounded to the market's tick.

4

Optionally the drift is removed, the average trend: the mean return is subtracted from every bar, so the series ends where it starts.

Exception: prices ≤ 0

With closes at zero or below, like the back-adjusted @CL, logarithms do not exist: the shapes are stored as point differences from the previous close.

Exception: intraday

By default whole days are shuffled: each day keeps its bars in order and with their times. That keeps the shape of the session and only breaks what links one day to the next. The first day stays in place, as the starting point.

A shuffle does not try to be a «realistic» market: it deliberately destroys memory and volatility clustering. It is a control group, not a scenario generator. It keeps what it should keep —the same set of candles, the same volatility, the same shocks— and removes the only thing a strategy could exploit.

The options

Remove the trend (recommended)

With the box ticked, the shuffled market ends where it starts. Untick it only if you want to compare with the trend included; for example, to find out how much of what a long-only strategy earns is due to the market's rise and not to its rules.

The seed

0 = a new order every time (the window tells you which one came out). A fixed number always gives the same shuffle: useful to repeat an experiment or share it. Daily @ES with seed 2026 reproduces the blog experiment exactly.

Intraday: whole days or single bars

Whole days (default): each day keeps its shape —the busy open, the quiet midday— and what links one day to the next is broken. It tests whether your edge depends on the market's history. Single bars: no structure is left, not even the session's. If your strategy lives off the shape of the day (buy at the open, exit at the close), use single bars: with whole days that shape is still there and the strategy would keep winning.

Negative prices

If the series has closes at or below zero (the back-adjusted @CL), the shuffle works in points instead of percentages. It works the same, but volatility no longer scales with price.

How to read the window

Once created you will see both markets overlaid —the real one in cyan, the shuffled one in magenta— and four measures, real → shuffled. All four check that the shuffled market is what it should be:

Volatility per bar · must be the same

How much the price moves from one bar to the next. On daily @ES, 0.84 % in both. The same shocks.

Trend over the period · must be zero

The real @ES is up 237 % since 2000; the shuffled one, 0 %. Buy and hold earns nothing. With intraday whole days, the first day's move remains, because it is not shuffled.

Memory · must be zero

The autocorrelation: whether what happened yesterday says anything about today. In the shuffled market, nothing.

Volatility clustering · must be broken

Whether a volatile bar tends to be followed by another one. On daily @ES it goes from 0.28 to 0.00. Shuffling whole days keeps the part within each day, which is expected.

Below is the list of your shuffled markets with their source, period, seed and type. The Delete button (two clicks) removes the market and its file. The files live in C:\AniQuant\datos\Barajados\, each with a .json summary next to it saying where it comes from and with which seed.

⚠️ This is made-up data

A strategy taken from a shuffled market is not fit for trading: whatever it earns there says nothing about the real market. So that one does not slip through by mistake, the market's description starts with «DATOS BARAJADOS» and, if you export the code of a strategy from that market to any platform, the export window warns you with a red band. It is not a test a strategy has to pass: it is a measure of the search, of how much the process you use to find strategies can fool you.

Try it yourself

AniQuant can be tried free for 14 days, with every module and no card. If you have the book, 30.

← Previous
AQ Holding Profile: how long to hold
Next →
Strategy portfolio
More in Market study