Trade Runs Test Calculator
Apply the NIST large-sample two-state runs statistic to an ordered W/L trade sequence, with observed runs, expected runs, variance and every run boundary visible.
Enter an ordered W and L sequence
Use W for win and L for loss, oldest to newest. At least 11 of each outcome are required for the disclosed NIST large-sample normal reference.
Use only W and L. Separate outcomes with spaces, commas, semicolons or new lines. Maximum 500.
Entered trade runs arithmetic
Entered Strategy Diagnostics 1.0.0.
| Run | Outcome | Start index | End index | Length |
|---|
How the trade runs statistic is calculated
Variance = 2nWnL(2nWnL − nW − nL) ÷ ((nW + nL)²(nW + nL − 1))
Z = (Observed runs − Expected runs) ÷ √Variance
A run is one uninterrupted block of the same outcome. For example, W W L L W contains three runs. Version 1.0.0 counts the entered order exactly and applies the published NIST expected-run and variance formulas.
NIST states that the standard-normal comparison is a large-sample procedure when both state counts exceed 10. This page enforces that boundary and uses the disclosed two-sided 5% reference of plus or minus 1.96 without continuity correction.
Assumptions and limits
- Only binary W and L outcomes are accepted; breakeven, partial and missing outcomes require a separately defined preprocessing rule.
- At least 11 W and 11 L outcomes are required, with a maximum of 500 total outcomes.
- Changing trade order can change runs while leaving win and loss counts unchanged.
- Crossing or not crossing the reference is not proof of independence or a stable process.
- No quality grade, clustering cause, next-trade probability, signal or recommendation is produced.
Worked example from the audited fixture
The audited 30-trade fixture contains 16 W outcomes and 14 L outcomes in the supplied order. That order produces 20 uninterrupted runs.
Z = (20 − 15.933333) ÷ 2.678594 = 1.518209
How to interpret the result
The fixture’s absolute Z score is inside the disclosed two-sided 5% reference of 1.96. Expected runs and variance depend on the two outcome counts, while observed runs also depend on order. Being inside the reference is not proof of independence or a next-trade forecast.
Frequently asked questions
- Enter an oldest-to-newest binary sequence using W for win and L for loss, with at least 11 observations of each state.
- A run is one uninterrupted block of the same outcome, so W W L L W contains three runs.
- Expected runs equal two times win count times loss count divided by their total, plus one.
- Observed runs minus expected runs is divided by the square root of the published runs variance.
- NIST describes the standard-normal reference as a large-sample procedure when both state counts exceed 10.
- No. It follows the displayed NIST Z formula directly and states that convention.
- No. This page describes one observed order; the probability tool models a future finite horizon under entered independent assumptions.
- No. It does not prove independence, identify a cause, grade a strategy, forecast the next outcome or create a signal.
Sources and methodology
- NIST/SEMATECH — Runs Test for Detecting Non-randomness — Published dichotomous-run definition, expectation, variance, Z statistic and large-sample boundary.
Compare ordered trade evidence
Compare the trading records behind your sample
Keep one broker account, return convention, fee treatment and sampling rule across the entered observations before comparing arithmetic.
FXOpen
Confirm account statements and trading conditions behind the entered sample.
Check FXOpen termsRisk and affiliate disclosure: Leveraged forex and CFD trading can result in substantial losses. These are affiliate links, so ForexMT4Indicators.com may receive compensation if you register or trade through them, at no additional cost to you. Availability and terms vary by jurisdiction and broker entity.

