Williams Percent Range Grid EA
- Experts
-
AL MOOSAWI ABDULLAH JAFFER BAQER
To trade successfully we need to go through the proven path that others had gone and reached!
Here are 17 quotes from such successful investors:
1- Limit your size in any position so that fear does not become the prevailing instinct guiding your judgment.
Joe Vidich - 버전: 2.10
- 업데이트됨: 5 11월 2026
- 활성화: 5
Before you pay anything, run Williams Percent Range Grid EA in the MetaTrader 5 Strategy Tester with visual mode on, and watch it sit perfectly still until the oscillator really leaves an exhausted zone.
EXHAUSTION FIRST. GRID SECOND.
Most grids open because a timer or a price distance says so. This one opens because sellers or buyers have demonstrably run out of breath: Williams %R has spent real time in its extreme zone and then crossed back out on a closed bar. Only then does a ladder begin, and every closure pairs the newest order with the oldest, so the heaviest position is always the next one to leave the book.
At a glance
• BUY cycle: %R crosses back above -80. SELL cycle: %R crosses back below -20. Closed bars only, so an arrow never moves after it is drawn.
• Zone Memory, the new filter: a one-bar flick into the zone is ignored. %R must have stayed there for at least 2 of the last 10 bars before the cross counts.
• A 30-bar quiet period between accepted entries keeps a choppy session from firing cycle after cycle.
• Reverse pair closing: newest plus oldest order close together as soon as their combined result clears your target.
• Pure one-direction grid: no hedge legs and no partial closes.
• No stop loss by default. An optional money limit exists and is off until you set it; please read the risk section before going live.
First steps
1. Attach it to EURUSD H1 and keep the defaults: 0.01 starting lot, 200 point spacing.
2. Allow algorithmic trading and read the panel. IDLE with a Williams %R reading means it is working and simply waiting.
3. Run the Strategy Tester on your own broker's data before any live use, because spreads, swaps and contract sizes differ.
4. Decide your limits (MinMarginLevel, MaxTotalRisk, MaxLossAmount) according to what your account can really carry.
Why Williams %R suits a grid
Williams %R asks one blunt question: where did this bar close inside the recent high-low range? Near the top reads close to 0, near the bottom close to -100. A reading deep in a zone says the crowd has pushed hard in one direction. A grid is at its weakest at the very start of a strong run, so waiting for the push to fade before the first order is the natural partner for this kind of management. It is a filter, not a forecast: a market can leave the zone and turn back in, which is exactly why the ladder and the limits below exist.
The life of one cycle
Step one, the wait. With no orders open the EA reads %R on the closed signal bar. A cross must pass Zone Memory and the bar delay. One signal bar can start one cycle only.
Step two, the first order. The starting lot opens in the direction of the cross, and an arrow marks the candle.
Step three, the ladder. If price moves against the newest order by the grid spacing, the next level opens with the lot multiplied by 1.25. At most one order per bar. The direction is always read from the live book, so a terminal restart never adds levels the wrong way.
Step four, the pair. Every second the EA adds the result of the newest and the oldest order, including swap and any commission you entered. When the sum reaches your target, both close. The ladder gets shorter from both ends and margin is released. A single remaining order closes alone when it reaches the target.
Step five, the return to idle. When the book is empty the EA waits for the next valid exhaustion signal. Nothing is forced.
The console panel
A dark card on the left of the chart, leaving candles and the price scale free. It shows direction and order count, lot ladder with next lot, spacing, book volume and net, banked profit, the live %R value with both levels, Zone Memory counters, the signal gate, the active timeframe and margin level, your recent closures, the open order table, and a plain state banner. It can be dragged with MOVE and minimised, it shrinks to fit small charts, and it draws nothing in a non-visual test, so optimisation stays fast. An Arabic line is optional.
Built to survive real trading conditions
• Margin check: one honest test before each order, margin x 1.5 must fit in free margin. No hidden ceilings.
• Lot ladder cap: the lot cannot keep climbing while pair closes keep the book small. With defaults a level is not opened once its lot would exceed MaxOrderVolume, which is around level 20 at 0.01 x 1.25.
• Netting accounts: NetMaxMarginPercent blocks new levels once used margin passes 5 percent of equity. It only blocks; it closes nothing.
• Second leg of a pair: if a close is refused it is retried on a timer, and the STUCK flag clears by itself as soon as a fresh book scan shows the leg gone or a retry succeeds. No restart is needed.
• Closed sessions: no order is sent while the symbol's trading session is closed, so a weekend or a daily break produces no error flood.
• Magic isolation: each chart manages only its own symbol and magic number, and a second chart with the same magic is refused.
• Margin timeframe safety, off by default: when margin level falls to your levels, the grid spacing widens to the ATR of a higher timeframe, and steps back after margin recovers.
What the tester showed
Default settings, my broker's demo data, 2025.01.01 to 2026.09.30, 1 minute OHLC model, leverage 100:
• EURUSD H1, 10,000 USD: net +868.86, equity drawdown 4.53 percent, 650 trades, profit factor 1.65, deepest level 12, no stop-out.
• XAUUSD D1, 10,000 USD: net +42.46, equity drawdown 0.30 percent, 15 trades, no stop-out.
• The same two runs at 1,000,000 USD gave identical money results with no margin refusal.
These are past simulated results on one data set. They are not a promise and your numbers will differ. That is why the free test comes first.
Every setting explained
Grid trading
GridSpacePoints - distance between levels in points (200). Raise it on volatile symbols such as gold.
GridSpaceMultiplier - grows the distance per level; 1.0 keeps it equal.
InitialLotSize - lot of the first order (0.01).
LotMultiplier - each level's lot is the previous one times this (1.25).
MaxGridLevels - most levels allowed (1000; in practice MaxOrderVolume stops the ladder far earlier).
UpDirectionIsBuy - true maps an upward cross to BUY; false inverts both directions.
LotLadderMaxLevel - highest level number used for the lot size (0 = the level limit).
Williams Percent Range entry
WilliamsPercentRange_Period - %R length (14).
WilliamsPercentRange_Timeframe - timeframe of the signal; current chart by default.
WilliamsPercentRange_OversoldLevel - crossing back above this starts a BUY (-80).
WilliamsPercentRange_OverboughtLevel - crossing back below this starts a SELL (-20).
SignalBarShift - 1 reads the last closed bar; 0 reads the forming bar and can change until it closes.
SignalBarsDelay - bars required between accepted entries (30; 0 = every signal).
WPR_ZoneMinBars - Zone Memory: bars needed inside the zone before the cross (2; 0 = off).
WPR_ZoneLookback - Zone Memory: bars searched before the cross (10).
Profit taking
DesiredProfitPerClosure - money target for each closure (2.0).
CloseReversePair - closes newest and oldest together; if off, a multi-order book is not pair closed.
Protection
OneOrderPerBar - at most one new order per bar (on).
MaxSlippagePoints - accepted slippage (30).
MaxSpreadPoints - no new order above this spread (7500).
MaxOrderVolume - largest single order (1.0).
MaxTotalOrders - cap on grid orders (1000).
EAMagicNumber - this EA's ID; use a different one on each chart.
UseFullCommission - counts commission for both sides of the trade.
CommissionPerLot - commission you pay per lot (0 = none counted).
MinMarginLevel - no new order under this margin level percent (0 = off).
MaxRiskPercent - limits a single order by risk over one grid step, percent of equity (0 = off).
MaxTotalRisk - no new order over this total grid risk or equity drawdown percent (0 = off).
MaxLossAmount - closes all this EA's orders if floating loss reaches this money amount (0 = off). This is the only input that closes at a loss.
NetMaxMarginPercent - netting only: new levels blocked above this used margin, percent of equity (5; 0 = off).
Close execution
PendingCloseRetrySeconds - pause between retries of a pair's second leg (5).
PendingCloseMaxAttempts - attempts before the pair shows STUCK (5).
StuckAutoClearSeconds - retry rhythm while STUCK (60).
Margin timeframe safety
UseMarginTFSafety - switches the feature on (off).
Level1MarginPct and Level1TF - at or below 6000 percent margin level, use M15.
Level2MarginPct and Level2TF - at or below 5000 percent, use H1.
MarginTFHysteresisPct - margin must recover this far above a level before stepping back (500).
MarginTFATRPeriod - ATR length that sets the wider spacing while a level is active (14).
Order comments
GridOrderComment - comment on grid orders; the level number is added to it.
CloseOrderComment - comment on closing deals.
Display
ShowPanel - shows or hides the panel.
PanelCorner - starting corner, 0 to 3.
PanelX and PanelY - offsets from that corner (30 and 30).
PanelBgColor and PanelTextColor - card and text colours.
PanelFontSize - base font size (9); the panel reduces it to fit.
MaxTableRows - open order rows shown (10).
ShowArabic - adds the Arabic line (on).
ShowChartMarks - draws the next level line and entry arrows (on).
Debug
DebugMode - detailed journal logging (off).
Plain words about risk
A grid adds to a losing direction. In a long one-way move floating loss grows, and with no stop loss set, that loss stays open until price returns or your own limits act. Pair closing reduces exposure but cannot remove this risk, and a large enough move can still take an account to a broker stop-out. Use a lot your balance can carry, set the protection inputs that match your tolerance, and never trade money you cannot afford to lose. The EA needs no DLLs and no extra files, and it runs on any symbol and timeframe, though spacing should suit each symbol.
If it finds a place on your charts, a short honest review of how it behaved for you, good or bad, helps the next trader decide.
