
Everyone who runs a grid, a martingale or any averaging system asks the same question — is my account big enough? — and almost everyone answers it with the wrong number.
The usual answer is the loss at the last grid level. That is not what ends the account. What ends the account is the margin level reaching the broker's stop-out, which happens while the chain is still open and still looks recoverable.
This Expert Advisor computes the real number, and then does the part that turns arithmetic into information: it scans the symbol's own M1 history and counts how many times a move that large has already happened.
It is strictly read-only. It never opens, closes or modifies a position.
The three mistakes it exists to fix, and they all err in the reassuring direction
What it reports
| Line | Meaning |
|---|---|
| full chain spans | Price distance from the newest leg to the oldest. |
| floating when full | The step × N(N−1)/2 figure, in account currency. |
| margin locked up | From OrderCalcMargin, not derived — only the terminal knows your broker's rules. |
| a full chain is | Floating plus margin, as a percentage of equity. |
| adverse move that ends it | How far price can travel against you before the broker acts. |
| legs open at that point | How many legs actually exist when it happens. |
| times in the last N days | How often a move that large occurred, counted on real M1 bars. |
Why the last two lines matter more than the rest
"You need 86 dollars of room" is an abstraction. "A move of 86 dollars happened 71 times in the last 100 days, one every 1.4 days" is a decision. The frequency is counted from a running extreme and restarts after each event, so one long decline counts once rather than once per bar — the figure stays comparable to a number of days.
And legs open at that point answers a question people argue about without measuring: if the account dies before the chain is full, your leg cap is never reached, and raising or lowering it changes nothing at all.
Three details that are easy to get wrong, handled here
Inputs
| Input | Meaning |
|---|---|
| InpGridStep | Distance between legs, in price (not points). |
| InpLots | Lots per leg. |
| InpMaxLegs | Legs per chain — your cap. |
| InpBothSides | Whether a long and a short chain run together. |
| InpEquity | Equity to assume. 0 uses the live account, so you can test a size you do not have yet. |
| InpStopOutLevel | Stop-out percentage. 0 asks the broker. |
| InpHistoryDays | Days of M1 history to scan. 0 skips the frequency check. |
On InpEquity. Setting it to a number the account does not have is the point, not a workaround: it answers "how much capital would this configuration actually need" without needing to deposit it first.
What it does not do
It is not a backtest and it says nothing about whether a strategy is profitable. It answers one question: given this configuration and this account, how far can price go against you before the broker closes you, and how common is a move that far.
It also does not model a recovery. A chain that survives is a chain price came back to — and this tool measures the excursion, which is what decides whether you are still there when it does.
Advanced Harmonic Scanner
The Advanced Harmonic & RSI Reversal Scanner solves both problems. By combining precise Fibonacci geometry (to find the location of a reversal) with an RSI exhaustion filter (to time the exact moment of the reversal), this script prevents you from catching falling knives
Tick Audit - check real tick history and backtest quality month by month
Reports, month by month, whether your symbol really has ticks or only bars - so you know which part of your backtest ran on generated ticks before you trust the curve. The Strategy Tester gives you one History Quality figure after the test has finished, and it never says which months were the problem. This script asks first.
AI Prompt Writer - Simple AI Assistant Customization
Customize your MetaTrader 5 AI Assistant with selectable language, personality, menu and behavior using a simple prompt file.
MT5 Memory Meter Panel
A lightweight memory meter dashboard that reveals current MT5 memory usage and key resource statistics directly on the chart.