Generation modes
The Mode selector (top panel of the Mass Test) decides how the combination space is searched. When the space is small it is worth trying all of it; when it is astronomical (millions or trillions of combos) you sample at random.
Do not confuse the Random (Monte Carlo) generation mode with the Monte Carlo Simulation in the Performance Report: here Monte Carlo means building combinations at random; there it means reshuffling the trades of a strategy you have already chosen.
It tries EVERY possible combination, with no cap and no sampling. Lazy enumeration in blocks: memory use stays constant however huge the space is.
It builds each combo at random: direction, number of conditions (k), the conditions themselves, TP and SL. It gives a fair shot to simple strategies (1-2 conditions), which tend to be the most robust.
It picks a global index at random and "un-ranks" it into the exact combo (a combinatorial number system). Mathematically uniform: every combo in the whole space is equally likely.
It does not search blindly: it evolves. It breeds strategies like a breeder — keeps the best, crosses and mutates them, and repeats generation after generation. Each round starts from the best of the last one, so it accumulates progress instead of starting from scratch.
The Genetic mode in depth
The random modes search blindly: each sample is independent and learns nothing from the past. The genetic one is different — it accumulates progress. It borrows the idea of natural selection: it keeps a population of strategies, holds on to the best ones, combines them with each other (crossover) and introduces small changes (mutation), then repeats. Generation by generation, the whole population drifts towards better and better strategies.
Its philosophy: explore widely (like the random mode) and then exploit and refine towards the good regions. For spaces of millions or trillions of combinations it is far more efficient than random sampling, because each round aims better thanks to what the last one learned.
Generation 0 is a random population. Each individual is a strategy = {direction, entry conditions, exit conditions, TP, SL} — its "DNA". Crossing and mutating manipulate that DNA, always producing valid strategies.
How many strategies live in each generation (individuals backtested per round). More population = more diversity and better exploration, but each generation costs more. Typically 200–1000.
The maximum number of evolution rounds. More generations give more time to refine, but there comes a point where it stops improving (it converges). Typically 30–100.
To choose each parent, N individuals are drawn at random and the one with the best fitness wins. A large N = more selection pressure (the good ones take over fast, at the risk of losing diversity); a small N = more randomness. Typically 2–5.
What fraction of the best strategies pass through unchanged into the next generation, without crossing or mutating. It guarantees the best find is never lost — which is why the curve never goes down. Typically 5–10%.
The chance that a child undergoes a mutation (changing a condition, adjusting the TP/SL, flipping the direction…). Little mutation converges fast but can stall; a lot explores more but is more chaotic. Typically 10–20%.
Fresh blood: every generation injects this fraction of completely random individuals. It fights "diversity collapse" (the whole population turning into clones and giving up on exploring). Typically 3–5%.
If the best fitness does not improve for N generations in a row, the engine stops on its own: it has converged and carrying on would waste compute. Set it to 0 to always exhaust every generation. Typically 10–15.
Instead of starting with a random Generation 0, it holds an audition: it evaluates N random candidates and starts with the best ones. That way the genetic mode begins with a decent squad and converges sooner and better. Typically 20,000; 0 = the classic random Gen 0. You can also seed from your Libraries (the «🧬 Seed the genetic» button).
It changes what the genetic mode is looking for: from "makes the most in the backtest" to "makes money and holds up". (1) Optimizes on the first 70% (holdout: the final 30% is kept as unseen validation). (2) Penalizes complexity (fewer conditions). (3) Rewards the sample (more trades = more believable). The ranking shows the In-Sample; take the winner to Walk-Forward / 360 Analysis to see the Out-of-Sample.
Each individual is scored with the same ranking criterion you pick at the foot of the window (Net P. $, Profit Factor, Net P. %, Win %). One important guardrail: strategies with fewer trades than "Min. Trades" get the lowest score and are never selected → the genetic mode does not converge on "flukes" built from 3 lucky trades.
While it runs, a chart appears next to the results table: the X axis is the generation and the Y axis the best fitness of that generation. The orange dots draw how the population improves round by round, live.
Thanks to elitism, the curve is a rising staircase (it goes up or stays flat, never down). The typical shape: big jumps at the start (the easy gains) and flattening at the end (convergence). If it flattens early, the search has already found its optimum in that space.
The Seed controls all the randomness (initial population, crossings, mutations). Same seed + same config ⇒ same evolution. With Seed 0 a new one is generated and shown next to the field.
The champions land in the same results table (top N) as every other mode, with identical hand-offs: Performance, Portfolio, Walk-Forward, 360 Analysis…
It runs on the CPU (multithreaded): it needs each generation's results in order to select. GPU acceleration is not available for this mode.
The genetic mode finishing quickly is not a flaw: it means it converges quickly towards what works. But if you want it to explore more deeply, you have four levers, from most to least impact:
In short: being fast and effective is a good sign — the genetic mode is efficient. Stretching it out makes sense when you are after a wider variety of edges or squeezing large search spaces.
Samples
In the random modes, the Samples field sets how many combos get tried (e.g. 1,000,000) and the sweep stops when it reaches them. In Exhaustive mode it is ignored and the field is disabled.
Seed
Leave the Seed at 0 and every run generates a fresh seed automatically → each pass explores a different random subset of the space. The seed actually used is shown next to the field (→ used: N); type it into the box to reproduce that same sweep.
If you type a fixed value, the random modes become reproducible: same seed + same configuration ⇒ same samples. In Exhaustive mode it is not used (the field is disabled): the enumeration is deterministic.
Constant memory (streaming top N)
Whatever the mode, AniQuant does not pile every result into RAM: it keeps only the top N by the ranking criterion (the MaxRes field), discarding the rest on the fly. That way memory use stays flat even if the sweep runs for hours or days.
GPU acceleration (OpenCL)
OPTIONALTick the GPU box to run the sweep on the graphics card through OpenCL: one GPU thread per combination. On large spaces it is typically 10-15× faster than the CPU. If there is no compatible OpenCL GPU, AniQuant says so in the log and falls back to the CPU automatically.
The bars and every indicator series are computed and uploaded to the GPU once; each batch only sends the combinations to evaluate.
While the GPU computes one block, the CPU is already enumerating and preparing the next (double buffering). That way the card never waits: utilization goes from around 50% up to nearly 100%.
Adjustable in Settings → Block size (combos per pass). The optimum depends on the machine; in testing around 25,000 worked best. Tiny or giant batches both do worse.
On startup it states the engine actually used (GPU + device name, or CPU + thread count) and the reason if the GPU was unavailable.
CPU and GPU produce the same metrics: the GPU only changes the speed, not the backtest logic.
Live progress
A progress bar at the foot of the window shows how it is going: during preparation (loading data and uploading series to the GPU) it animates in marquee mode, and switches to a real percentage once the sweep starts. The status bar refreshes every block (around 50,000 combos) and the results list updates live:
- →combos done / total and %
- → number of valid results found
- →rate (combos/s) and estimated ETA
If the ETA goes past 10 years, the system warns you to "narrow the parameter ranges": the space is too big, even though it no longer exhausts memory.
Exhaustive: when the possible combos are few — it guarantees 100% of the space.
Random (Monte Carlo): the general-purpose option for large spaces; it favors simple, robust strategies.
Random (Uniform): when you want a statistically representative sample of the complete space.
Genetic: when the space is enormous and you want the search to learn and refine towards the best, instead of sampling blind. The most powerful for discovering strategies.
AniQuant can be tried free for 30 days, with every module and no card.