Streak Intuition Simulator
A trader running a system with a genuine 55% win rate still expects to see multi-loss runs - that is simply what a sequence of independent coin flips looks like. In practice, a losing streak of six or seven trades in a row is very often read as proof something changed, even though nothing did; it is well within ordinary binomial variance at that win rate and sample size. This script runs the actual simulation instead of relying on intuition. It simulates a large number of independent trade sequences at a chosen win rate, using the built-in pseudo-random generator, and records the LONGEST losing streak within each sequence. It then reports the distribution of that longest streak across all simulated sequences - the median, the 90th and 99th percentile, and the single worst case seen - plus the exact percentage of sequences in which a streak at least as long as the user's own "this looks broken" guess actually occurred. A rough analytic cross-check (the expected count of streaks of that length or longer, from the standard run-length approximation) is printed alongside the simulated numbers as a sanity check, not a replacement for the simulation. The result reframes "I just lost N in a row" from a verdict on the system into a question with an actual base rate: how often does that happen anyway, purely from variance, at the win rate the trader believes they have. Notes and limitations - The simulation assumes each trade is an independent Bernoulli trial at a fixed win probability - it deliberately does not model streaks clustering from a real strategy's serial correlation, regime changes, or a genuinely degrading edge. A real trading system may have correlated outcomes that this simple model does not capture; treat the reported numbers as a variance FLOOR for an honestly independent system, not an upper bound on how bad a real streak could get. - Uses only wins and losses - it does not model trade size, R-multiples or asymmetric payoff, so it answers "how long is a losing streak likely to be", not "how much money is at risk in one". - The printed analytic cross-check is an order-of-magnitude approximation for sanity-checking the simulation, not an exact formula for the longest-run distribution. - Uses the built-in MathRand()/32768 uniform generator; this is adequate for the number of trials here but is not a cryptographic or high-precision statistical random source.
Script · MT5 · v1.0 · Free
About Streak Intuition Simulator
Streak Intuition Simulator is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 5 settings, such as Win rate pct, Trades per run and Run count. MQL source code included.
Files in the download: StreakIntuitionSimulator.ex5, StreakIntuitionSimulator.mq5, StreakIntuitionSimulator.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Win rate pct | 55.0 | Per-trade win rate to simulate, percent |
| Trades per run | 200 | Number of trades in each simulated sequence |
| Run count | 2000 | Number of independent sequences to simulate |
| User guess streak | 6 | The losing-streak length the user thinks looks "broken" |
| Random seed | 0 | Seed for MathSrand (0 = use GetTickCount, different every run) |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Alerts · MT5 Script · MQL5 Source Code