Grid Vortex Indicator 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 - Versione: 3.15
- Attivazioni: 5
See it before you decide: run Grid Vortex Indicator EA in the MetaTrader 5 Strategy Tester with visual mode on, and watch it pass over cross after cross until one side truly takes charge of the market.
ONE SIDE TAKES THE LEAD. ONLY THEN DOES THE GRID BEGIN.
Etienne Botes and Douglas Siepman published the Vortex Indicator in 2010, built on a simple observation: in a healthy advance each bar's high reaches well above the previous bar's low, and in a healthy decline each low reaches well below the previous high. Add up those reaches over a set of bars, divide by the true range, and you get two lines. VI+ measures upward reach and VI- measures downward reach. When they swap places, control may be changing hands. The catch is that in a quiet market they swap places again and again. Grid Vortex Indicator EA treats that as the central problem. It accepts a cross as the start of a grid cycle only when the lines have separated, the winner is genuinely strong, the recent past is not a knot of earlier crosses, and the slow trend agrees. After that, a complete grid management engine works the book, trimming the oldest exposure through group closures and partial slices.
What you get
• A BUY cycle can begin only when VI+ crosses above VI- on a closed bar and every guard passes; a SELL cycle needs the mirror cross. Closed bars only, so an accepted signal never moves after it is marked.
• Both Vortex lines are calculated inside the EA from the bars' own highs, lows and closes. There is no custom indicator file to install.
• New in this product: the Tangle Guard. It counts how many times the two lines crossed in the bars before the current cross, and it refuses the signal when the market has been flipping back and forth.
• The Gap Guard wants daylight between the lines on the cross bar, so a touch that barely changes the order is skipped.
• The Leader Guard wants the winning line at a real strength level, 1.00 by default.
• A slow EMA filter is on by default, so a cycle starts on the side of the larger direction. You can turn it off or use it to fade instead.
• Every recent cross is marked on the live chart: a small arrow where it passed the guards, a grey dot where it was refused, so you can see the filtering with your own eyes.
• Profits are banked by groups of the oldest and newest orders, and a heavy old order is retired in partial slices rather than left waiting for a full return.
• No stop loss and no forced close-all. A reached limit refuses new levels while the existing book keeps being managed, which also means the EA does not cap your losses.
START HERE
Begin on EURUSD H1 or XAUUSD D1 with the default 0.01 lot and the additive ladder. Set RunMode to Scan only for the first session: the panel then displays every plan the EA would carry out, without sending a single order, and one button moves it to Armed when you are satisfied. Spreads, swaps and commissions change from broker to broker, so run the Strategy Tester on your own data before going live. With a small balance, keep the starting lot and let the tester show how deep the book can grow on your symbol. To reproduce our figures below, use the default inputs and the same dates.
Why so many guards around one cross
A plain Vortex crossover is a fine alert for a human, who can glance at the chart and shrug. A grid cannot shrug. Once it opens the first level it has no stop to take it back out, so a poor start stays on the book until the engine works it off. That raises the price of a false signal, and false signals are exactly what a raw crossover produces in a sideways market. The answer here is not a cleverer formula. It is a set of plain questions, each visible on the panel: are the lines apart, is the leader strong, has this market been tangled, and does the slow trend agree? If any answer is no, the EA waits. You will see fewer cycles than a raw crossover gives, and that is the point. It is not a promise that the cycles it does start will go your way; it is a clear and checkable condition.
The improvement in this release
The Tangle Guard is this EA's own addition. At each cross it looks back over a chosen number of bars, 20 by default, and counts earlier crosses of the same two lines. Up to two are tolerated. More than that and the market is treated as knotted, so the new cross is refused however good it looks on its own. Set the bars to 0 to switch the guard off. The panel shows the live count as KNOT, with OPEN or HOLD, beside the gap and leader readings. The chart marks are new as well: refused crosses stay visible as grey dots, so nothing is filtered behind your back. Margin-level timeframe safety is included and is off by default.
One cycle, step by step
1. The read. On every closed bar the EA adds up the upward reach, the downward reach and the true range over your Vortex period, and works out VI+ and VI-.
2. The cross. VI+ must have moved above VI- for a BUY, or VI- above VI+ for a SELL, on the signal bar itself.
3. The Gap Guard. The distance between the two lines on that bar must reach your minimum.
4. The Leader Guard. The higher of the two lines must reach your strength level.
5. The Tangle Guard. Earlier crosses in the look-back window must not exceed your maximum.
6. The trend filter. By default the close must be on the trade's side of the slow EMA. It can be switched off, or set to fade.
7. The rhythm. A quiet gap of bars between accepted signals stops a restless session from starting cycle after cycle, and a signal stays valid for a few bars if a level cannot be placed at once.
8. The ladder. Levels are spaced by fixed points or by ATR, with a floor, an upper limit and an option to freeze the distance for the whole cycle. BUY and SELL grids can run together or one direction can run alone.
9. The harvest. The closer searches for groups of the oldest and newest orders and closes a group as soon as its combined result, after swap and commission, beats your target. When the oldest order is still too heavy, only a slice of it goes, paid for with profit already on the table.
10. The safety checks. A reopen guard blocks any closure that would put the same level straight back on. Each leg is confirmed against the deal history, failed legs wait in a retry queue, and a plan is abandoned if the book changes between the scan and the send.
11. The optional hedge cycle. Off by default. When on, it holds a balanced pair on a symbol you choose and retires it in equal slices, funded by a small surcharge on closures the grid is already making.
The panel
The panel sits on the left and leaves the right side and the price scale free. It shows the symbol and magic number, a status pill (ARMED, SCAN ONLY or PAUSED), grid mode, lot step, spacing, banked result, the book in lots with its net result, the closing plan for each side with its own close button, and the order list. The VORTEX PULSE row gives the period, the current VI+ and VI-, which side leads, and how many bars ago the lines last crossed. The VORTEX GUARD row gives the gap, the leader value and the KNOT count, each marked OPEN or HOLD, followed by the EMA side and filter mode. Buttons switch Armed / Scan only, Pause / Resume, chart marks and slicing. The Hedge Vault card is docked directly under the main panel and moves with it when you drag or minimise. The panel scales with the screen and draws nothing in a non-visual backtest, so optimisation stays fast.
Protection you control
No stop loss and no forced close-all. A reached limit stops new levels; it never dumps the book at a bad moment.
Before each order the money check asks one plain question: is there enough free margin, with a safety buffer, for this order?
Limits on levels per grid, orders per side and lot per order keep the ladder bounded, and the lot ladder stops growing at the level limit.
The code caps the margin of a merged position on netting accounts as a percentage of equity. Our own tests ran on a hedging account, so try this on your own netting account in the tester first.
Optional margin-level timeframe safety moves the signal and the spacing to a higher timeframe when the margin level falls to your chosen levels, and moves back only after margin recovers past a cushion. Off by default.
Every copy isolates itself by symbol and magic numbers, so several charts never touch each other's orders or saved state.
Scan only mode shows every decision without sending any order.
Our own test figures
Strategy Tester, 1 minute OHLC, 2025.01.01 to 2026.09.30, leverage 1:100, default inputs, hedging account:
• EURUSD H1, $10,000 deposit: net result +973.65, maximal equity drawdown 3.40%, 487 trades, no stop-out and no margin refusals.
• EURUSD H1, $1,000,000 deposit: net result +973.65, maximal equity drawdown 0.04%, 487 trades, no stop-out and no margin refusals.
• XAUUSD D1, $10,000 deposit: net result +49.89, maximal equity drawdown 0.42%, 18 trades, no stop-out and no margin refusals.
• XAUUSD D1, $1,000,000 deposit: net result +49.89, maximal equity drawdown 0.00%, 18 trades, no stop-out and no margin refusals.
These are simulations of one past period on one broker's data, not a forecast. The 18 XAUUSD trades are far too few to prove anything, and another period can end very differently. Commission, slippage and real execution on your account will differ too. The grid's real danger, a long trend against a deep book, is not ruled out by these runs.
Who it suits, and who it does not
It suits traders who want to see why a cycle started, who accept fewer signals in exchange for cleaner ones, who prefer many small closures to one distant target, and who will size the lot for their own account. It does not suit anyone who needs a stop loss on every order, a promised monthly figure, or a set-and-forget robot running large lots on a tiny balance.
Quick answers
Does it repaint? No. Signals come from closed bars, and the values of a closed bar do not change.
Why does it sometimes sit idle for a long time? Because the guards are strict by design, and the XAUUSD D1 test above shows how few trades that can mean on a slow chart.
How is this different from a moving average cross? The Vortex lines compare how far each bar reaches beyond the previous one, measured against true range. There is no price average in the signal; the only average is the optional trend filter.
Do I need to attach a Vortex indicator? No. Everything is calculated inside the EA, and the crosses are marked by it on the live chart. The two lines themselves are shown as numbers on the panel, not drawn in a sub-window, so the panel keeps the full chart height.
Can I make it trade more or less often? Yes. Lower SignalBarsDelay, the Gap or Leader minimums, or turn off the trend filter for more cycles; raise them or tighten the Tangle Guard for fewer.
Every setting explained
Grid - how levels are opened
TradeMode - dual grid by default (BUY and SELL side by side), or one direction only.
GridSpacePoints - fixed distance between levels in points when ATR spacing is off (25).
GridSpaceMultiplier - 1.0 keeps levels evenly spaced; a higher value spreads deeper levels further apart.
MaxGridLevels - the most levels one grid may hold (1000).
UpDirectionIsBuy - decides which side an upward move belongs to.
EAMagicNumber - the ID written on this EA's grid orders (9754370).
GridOrderComment - the comment on each grid order (GVTX).
OneOrderPerBar - no more than one new level per bar.
Lot ladder
InitialLotSize - volume of the first level (0.01).
LotSizingMode - additive by default, or multiply.
LotMultiplier - in multiply mode, each level is the previous lot times this value (1.25).
LotAddStep - in additive mode, the volume added at each level (0.01; 0 means the starting lot).
MaxOrderVolume - the largest lot any single order may use (1.0).
UseAutoLot - scales the starting lot with the balance (off).
AutoLotBaseBalance - the balance that matches the starting lot (1000).
AutoLotAllowDecrease - lets auto lot go below the starting lot (off).
ATR spacing
GridSpacingMode - ATR by default, or fixed points.
ATRTimeframe - the timeframe volatility is measured on (current chart).
ATRPeriod - ATR length (14).
ATRSpacingFactor - spacing equals ATR times this value (1.0).
ATRBarShift - 1 uses the last closed bar.
ATRMinSpacingPts - the smallest allowed spacing in points (50; 0 means none).
ATRMaxSpacingPts - the largest allowed spacing in points (5000; 0 means none).
ATRFreezeOnStart - keeps one spacing for the whole cycle (off).
Profit target
DesiredProfitPerClosure - the base target in account currency (2.0).
ProfitMultiplier - scales the final target between 1.00 and 2.00.
ProfitTargetMode - scaled by default, so a bigger and deeper book must earn a bigger result.
ProfitVolumePower - how strongly closing volume lifts the target (1.0; 0 turns it off).
ProfitDepthBonus - extra target for each additional open level (0.10).
ProfitMaxMultiple - the cap on the scaled target as a multiple of the base (50).
ProfitMaxReachFraction - keeps the target within a fraction of one grid step so it stays reachable (0.50).
Fragment scanner
UseMultiLegScan - tests combinations of several orders before the simple pair (on).
MaxOldestLegs - the most oldest orders allowed in one closure (3).
MaxNewestLegs - the most newest orders allowed in one closure (6).
ScanPriority - how qualifying groups are ranked; most orders first by default.
NeverBankLessThanPair - a group must also beat the plain pair target (on).
RequireCloseVolumeExceedsTarget - the newest volume must outweigh the oldest volume (on).
MinCloseVolumeRatio - minimum ratio of closing volume to target volume (1.5).
Target slicing - partial closes
EnableTargetSlicing - closes a slice of the oldest order when the whole lot cannot be paid off yet (on).
FragProfitWeightPower - how profit is weighted per closing lot (1.5).
FragMinSlicePercent - the smallest slice as a percent of the target order (20).
FragAllowMultiCloser - lets several newest orders pool their profit to pay for one slice (on).
FragPreferFullClosure - a full closure wins over a slice whenever both qualify (on).
Reopen guard
ReopenGuard - blocks closures that would immediately reopen a level (step based).
ReopenGuardCushion - the safe distance as a fraction of one grid step (0.90).
Account protection
MinMarginLevelPercent - no new levels below this margin level percent (0 = off).
MaxAccountRiskPercent - no new levels above this floating loss as a percent of balance (0 = off).
NetMaxMarginPercent - on netting accounts, the largest margin of the net position as a percent of equity (5.0).
MaxTotalOrders - absolute cap on grid orders per side (1000).
Execution and verification
RunMode - Armed or Scan only; Scan only is the gentle first step.
CloseSequence - the order in which legs are sent; oldest first by default.
MaxSlippagePoints - maximum slippage (30 points).
MaxSpreadPoints - trading pauses above this spread (7500 points).
MinSecondsBetweenClosures - minimum pause between two closures on the same side (5 seconds).
CloseAttemptsPerLeg - send attempts before a leg moves to the retry queue (3).
VerifyTimeoutSeconds - how long a stuck leg keeps being checked (90 seconds).
DeferWhenMarketClosed - waits for the session instead of halting when the market is closed (on).
MarketClosedRetrySeconds - retry interval while the broker refuses orders (30 seconds).
AutoResumeAfterSeconds - clears a halt by itself after this many seconds (300; 0 waits for the panel button).
NoPartialRetryMinutes - tries partial closes again this many minutes after a broker refusal (15; 0 never).
AbortIfBookChanged - drops a plan if a leg changed between the scan and the send (on).
UseFullCommission - counts commission for both sides of a trade (on).
CommissionPerLot - fallback commission when history has none (0 reads it from history).
CloseOrderComment - the comment on closing deals.
Hedge cycle
EnableHedgeCycle - off by default.
HedgeSymbols - comma-separated list of hedge symbols; repeating one gives it more turns (XAGUSD).
HedgeSymbolRotation - how the next cycle's symbol is picked (per cycle).
HedgeMaxSymbolsInTester - limits rotation in the Strategy Tester only (2; 0 means no limit).
HedgeCycleLots - lots on each side of the balanced pair (0.01).
HedgeSliceLots - lots retired from each side per slice (0.01).
HedgeFragmentBonus - extra amount added on top of the slice cost (100).
HedgeBonusIsPercent - the bonus is a percent of the slice cost; false makes it a fixed amount (on).
HedgeMaxSurcharge - money cap on what one closure may be surcharged (0 = no cap).
HedgeMaxSurchargePercent - the most the hedge may raise any closure target, in percent (50).
HedgeMagicNumber - the hedge legs' ID; it must differ from the grid's (9754371).
HedgeReopenOnFinish - opens a fresh cycle when one finishes (on).
HedgeStartRequiresTrade - waits for the grid to open something before the first cycle (on).
HedgeIntegritySeconds - how often both legs are checked to be equal (5 seconds).
HedgeAutoRepair - repairs a lone leg automatically (on).
HedgeNakedAction - what to do with a lone leg; re-hedge by default.
HedgeMaxSpreadPoints - no hedge orders above this spread (0 = off).
HedgeSlippagePoints - maximum slippage on hedge orders (30 points).
HedgeAttemptsPerLeg - send attempts per hedge leg (3).
HedgeVerifyTimeout - how long a stuck hedge leg keeps being checked (90 seconds).
HedgeCommissionPerLot - fallback hedge commission (0 reads it from history).
HedgeOrderComment - the comment on hedge deals.
Weekly cash day
WeeklyCashDay - no new hedge cycle and no slice during your withdrawal window (off).
CashDayOfWeek - 0 Sunday, 1 Monday and so on (1).
CashCutoffHour - server hour after which no new slice is fired (21).
Panel and chart
ShowPanel - shows or hides the panel.
PanelX and PanelY - panel offsets from the chart edges (12 and 15).
PanelFontSize - base font size (9).
ShowArabic - adds an Arabic line under the English on the panel (on).
ShowChartMarks - draws plans and levels on the chart (on).
MaxTableRows - order rows shown per grid (13).
PanelCorner - the chart corner the panel is anchored to.
Entry trigger
EntryTriggerMode - the Vortex Indicator strategy arms the first level by default.
SignalBarShift - 1 means the last closed bar.
SignalBarsDelay - bars that must pass between accepted signals (30; 0 accepts every signal).
SignalValidBars - a signal stays usable for this many bars (3).
SignalAllowBuy and SignalAllowSell - turn each direction on or off separately.
SignalReverse - inverts the direction (off).
Vortex Indicator - the signal
InpVTXPeriod - how many bars are summed for VI+ and VI- (14; must be 2 or more).
InpVTXGapMin - Gap Guard: the smallest distance between VI+ and VI- on the cross bar (0.05; 0 = off).
InpVTXLeaderMin - Leader Guard: the level the winning line must reach (1.00; 0 = off).
InpVTXTangleBars - Tangle Guard: how many bars before the cross are checked for earlier crosses (20; 0 = off).
InpVTXTangleMax - Tangle Guard: the most earlier crosses allowed in those bars (2).
InpVTXTrendFilter - 0 off, 1 trade with the EMA side, 2 trade against it as a fade (1).
InpVTXTrendMAPeriod - the trend EMA length (200).
InpShowSignalArrows - arrows on the candles where a cycle was armed (on).
InpShowVTXOnChart - marks recent Vortex crosses on the live chart candles, arrows for passed and grey dots for refused (on; no extra sub-window).
Debug
DebugMode - detailed journal logging (off).
Margin timeframe safety
UseMarginTFSafety - off by default.
Level1MarginPct and Level1TF - at or below 6000 percent margin level, work on M15.
Level2MarginPct and Level2TF - at or below 5000 percent, work on H1.
MarginTFHysteresisPct - how far margin must recover above a level before stepping back (500).
Honest expectations
A grid manages a position; it cannot see the future, and it can lose a large part of an account. Grid Vortex Indicator EA is selective about when a cycle begins, but a clean cross can still fail a few bars later. With no stop loss, the book then stays open and grows while the move runs, up to the limits you set. Pick a lot your account can carry through that, test on your own broker first, and let the Strategy Tester show you how it behaves before you trade it live. It runs on any symbol and timeframe and needs no DLLs and no extra files.
If you use it, a short and honest review of how it behaved on your account, good or bad, helps other traders make their choice.
