Randomness enters a Deriv synthetic-index backtest from at least three places: the random seed that initialises the generator, the stochastic parameters of the strategy itself, and any resampling used to estimate robustness. If you do not control these sources, two runs of the “same” bot can produce different equity curves and you cannot tell whether a change in results came from your code, your parameters, or chance. This article shows how to make randomness explicit, seeded, logged and comparable, so a backtest becomes a document a reviewer can re-run rather than a one-off observation.
Trading involves significant risk and you can lose your entire stake. Test every strategy on a demo account first.
Why determinism matters for a filter, not a proof
A backtest on Deriv synthetic indices is a filter. It removes clearly bad configurations; it does not certify good ones. That filtering role only works if the test is repeatable. If run A and run B differ because the random stream differed, you have learned nothing about the parameter change between them.
Synthetic indices are generated by Deriv’s own random process, and the live stream you will eventually trade is not the historical stream you tested on. Your backtest therefore needs a model of that stream, and the model’s randomness must be under your control. The same discipline applies to forex pairs you test through the Deriv API: historical ticks are fixed data, but any bootstrap or shuffle you apply to them is your randomness, not the market’s.
The practical rule is simple: every random draw in the test harness must come from a named generator with a recorded seed, and every stochastic parameter must appear in the run manifest. No data, no claim; no manifest, no comparison.
Seeding the generator and logging the manifest
Most languages expose a pseudo-random generator you can seed. Use one generator per purpose so that changing the order of one operation does not silently shift every other stream.
- Seed the data model generator (synthetic tick synthesis or historical resampling) separately from the strategy generator (random entry offsets, randomised parameter draws).
- Record the seed, the generator algorithm, the library version, and the exact parameter set in a manifest file written next to the results.
- Record the number of configurations tried. If you tested 200 parameter sets and report the best, the reviewer must know that 200 were tried, because the best of 200 is not the same claim as the best of one.
- Version the strategy rules before the run. Changes follow a process: hypothesis, test, version. Never change rules immediately after a loss and re-run until the curve looks better.
A minimal manifest, as pseudo-code:
run_id: 2026-11-15-A
strategy: rise_fall_v3 (rules hash: 9f2c...)
market: R_100 (synthetic index)
data_model: seeded tick synthesis, seed=12345, algo=PCG64
strategy_rng: seed=67890
params: stake=0.35, duration=5 ticks, barrier=none
configs_tried: 48
session_limits: daily_loss=3.50, max_drawdown=5.00, max_consec_loss=6
The manifest is the difference between “it worked” and “here is exactly what was run, and you can run it again.”
Worked example: seeded Monte Carlo on a fixed-stake contract
Suppose you test a Rise/Fall strategy on a synthetic index with a fixed stake of 0.35 USD per contract and a payout of 0.33 USD profit on a win (a payout ratio near 94%, illustrative). The balance is 35.00 USD. Per the ORSTAC premise, stake is the maximum loss on a fixed-stake contract, and 0.35 is 1% of 35.00, which sits at the ceiling of the recommended range.
You want to know how often a 200-contract session ends in drawdown beyond a hard limit of 5.00 USD. You cannot answer that from a single path, so you resample: run the same strategy over 1,000 seeded synthetic paths, each path a fresh draw from the data-model generator, all sharing the strategy seed so the strategy’s own random choices are identical across paths.
Assume, purely as an illustration, that the strategy wins 50% of contracts. Expected profit per contract is:
- Win: +0.33 with probability 0.50 → +0.165
- Loss: −0.35 with probability 0.50 → −0.175
- Expectancy: 0.165 − 0.175 = −0.010 USD per contract
Over 200 contracts the expected result is 200 × (−0.010) = −2.00 USD. The break-even win rate for this payout is 0.35 / (0.35 + 0.33) = 0.35 / 0.68 ≈ 51.5%. At a 50% win rate the strategy is below break-even, so the Monte Carlo is measuring how a negative-expectancy process distributes losses, not whether it profits.
Now the drawdown question. With a 5.00 USD hard limit and a 0.35 stake, a run of consecutive losses alone can breach it: 5.00 / 0.35 ≈ 14.3, so 15 consecutive losses exceed the limit. On a fair coin that run has probability 0.5^15 ≈ 0.0000305 per starting position, but there are many starting positions in 200 contracts, so the expected number of such runs is not the same as that small probability. This is exactly why you resample rather than reason from a single number: the Monte Carlo reports the fraction of paths that hit the limit, and that fraction is an empirical count from your 1,000 seeded runs, not a theoretical guarantee. Report it as a count: “in 1,000 seeded paths, N hit the 5.00 USD drawdown limit.”
The point of the example is not the specific figures, which are illustrative. It is that the seed makes the 1,000 paths identical on every re-run, so the count N is comparable when you change one parameter.
Controlling stochastic parameters and resampling
Stochastic parameters are the strategy inputs you deliberately randomise: entry timing jitter, a random choice among equivalent barriers, or a parameter drawn from a range during a sensitivity sweep. Treat each as a recorded draw.
- Fix the strategy seed so the sequence of random parameter choices is identical across data-model resamples. This isolates data variation from strategy variation.
- When sweeping parameters, use a common random number scheme: the same seeds across configurations, so differences in results reflect the parameter, not a different random stream.
- For historical forex data, resampling means block bootstrap or shuffle. Record block length and seed. A shuffle that destroys serial dependence will flatter strategies that depend on it; say so in the report.
- For synthetic indices, state clearly that you are testing against a synthesised stream, not Deriv’s production generator, and that the live stream may behave differently. The synthetic indices documentation describes the products; it does not hand you a replayable historical tape for every index.
A short numbered rule set for a DBot-style harness:
- Load the run manifest and abort if any seed or version field is missing.
- Initialise the data-model generator from its seed.
- Initialise the strategy generator from its seed.
- Run the strategy to completion or until a hard limit fires; log the stop reason.
- Write results and the manifest hash to the run directory.
- Repeat for the declared number of resamples; never change parameters mid-sweep.
The Deriv API documentation and the official API libraries cover the live interfaces; the seeding discipline above is yours to implement in the harness around them.
Limitations
Seeding does not make a backtest predictive. It makes it repeatable. A seeded run against a synthesised stream can be perfectly reproducible and still wrong about the live market, because the model is not the market. Monte Carlo resampling estimates the distribution under your model and your assumed win rate; if the assumed win rate is optimistic, the resampled drawdown counts are optimistic too.
Determinism also does not remove execution differences. Demo trading removes financial risk but not behavioural or execution differences: fills, latency, and your own reactions differ between demo and live. Stop loss and take profit by price exist only for Multipliers; for fixed-stake contracts, risk is controlled by stake, duration and session limits, and those limits must be hard and automatic in the bot. Finally, any progression scheme, including martingale, needs a hard cap on steps and stake and a ruin test before going live; ORSTAC recommends against martingale, and a seeded backtest of a martingale can look smooth while hiding tail risk that the seed never sampled.
Frequently Asked Questions
Does a fixed seed make my backtest valid?
No. A fixed seed makes the run reproducible; validity depends on the data model, the sample size, out-of-sample testing, and honest reporting of how many configurations were tried.
Should I report the best of many seeded runs?
Report the count of configurations tried and the distribution of results, not only the best. The best of many runs is a selected maximum and overstates typical performance.
Can I use the same seed for live trading?
No. The seed exists to make tests comparable; live trading draws from Deriv’s stream, and reusing a test seed would only create a false sense of continuity.
Key Takeaways
- Seed every random source separately and log the seed, algorithm, library version and parameters in a run manifest.
- Use common random numbers across parameter sweeps so differences reflect parameters, not chance.
- Report the number of configurations tried and treat the backtest as a filter, not proof.
- Judge by expectancy, break-even rate and drawdown; win rate alone means nothing without the payout.
- Keep hard automatic limits in the bot and test on a demo account before any real stake.
Deterministic, documented backtests are the minimum bar for review. The ORSTAC repository hosts open-source bots you can run against Deriv, where a free demo account is available to test them, and discussion of harness design and manifests happens in the ORSTAC Telegram group. Bring your manifest, your seed, and your config count.
Trading involves significant risk and you can lose your entire stake. Test every strategy on a demo account first.
