Grid Relative Vigor Index 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 - 버전: 3.15
- 활성화: 5
See it work before you spend anything: load Grid Relative Vigor Index EA into the Strategy Tester, switch on visual mode and watch the panel measure market vigor, open each level and bank each closure candle by candle.
A GRID THAT WAITS FOR REAL CLOSING STRENGTH BEFORE IT OPENS A SINGLE ORDER.
Grid Relative Vigor Index EA lets the Relative Vigor Index judge whether buyers or sellers are actually finishing their candles strong, then passes the position to a complete grid management engine that keeps paying down the oldest exposure a piece at a time.
At a glance
• Entry comes from the RVI main line crossing its signal line on a closed bar, so nothing repaints.
• The new Zone-Exit Guard only accepts a cross that begins on the far side of the zero zone, the moment vigor turns rather than the middle of a move.
• Profits are taken in groups of the oldest and newest orders, with partial slices when a whole old order is still too heavy.
• No stop loss and no forced close-all; protection blocks new levels instead of throwing the book away.
• Hedging and netting accounts are both handled, and every limit is a visible input.
QUICK START
Good first symbols: EURUSD or XAUUSD. Good first timeframe: H1. Lot: the default 0.01 with the additive ladder. Mode: begin in Scan only, read the plans on the panel for a while, then switch to Armed. Always test on your own broker's data first, because spreads, swaps and commissions are never the same twice.
Why vigor, and why it matters for a grid
The Relative Vigor Index rests on a simple market habit: in a healthy rise, candles tend to close nearer their highs than their opens; in a healthy fall, they close nearer their lows. RVI compares the body of each candle with its full range and smooths the result into two lines, a main line and a slower signal line. When the main line crosses its signal line, the balance of closing strength has changed hands. Most grids start wherever price happens to be standing. This one waits until the candles themselves show that one side has begun to finish stronger, and only then gives the grid permission to build.
What is new in this release
The Zone-Exit Guard is the fresh idea in this EA. A BUY cross counts only when the RVI main line was sitting at or below the negative zone level on the bar before the cross, and a SELL cross only when it was at or above the positive level. In plain words, the EA wants to catch vigor turning up from weakness or turning down from strength, not a late cross that happens after the move is already well under way. With the default level of zero, a BUY must come from below the zero line and a SELL from above it. The panel gains an RVI ZONE row that shows whether the main line is in the UPPER, MID or LOWER zone and whether the guard is currently open for a BUY, open for a SELL or waiting. Margin-level timeframe safety is also built in and is switched off by default.
How one cycle unfolds
1. The reading. At every closed bar the EA reads the main and signal lines from the built-in MetaTrader 5 Relative Vigor Index. The forming candle is never used, so what you see on history is what the EA saw at the time.
2. The cross. A BUY cycle is considered when the main line crosses above the signal line; a SELL cycle when it crosses below. An optional minimum gap can demand that the two lines have really separated on the signal bar.
3. The zone check. With the Zone-Exit Guard on, the cross must start from the correct side of the zone level, which filters out crosses in the crowded middle.
4. The optional trend filter. An EMA can confirm the side: trade only with it, trade only against it as a fade, or leave it out.
5. The rhythm. A quiet gap of bars between accepted signals stops a choppy session from firing a burst of cycles, and a signal can stay valid for a few bars when a level could not be placed straight away.
6. The ladder. Levels open at a fixed or ATR-based distance, with a floor, a ceiling and an option to freeze that distance for the whole cycle. BUY and SELL grids can run side by side or one direction at a time.
7. The harvest. The closer searches for groups made of the oldest and newest orders and closes a group as soon as its combined result, after swap and commission, clears your target. When the oldest order is still too heavy, only a slice of it is closed, funded by profit that is already open.
8. The guard rails. A reopen guard refuses a closure that would immediately reopen the same level. Every leg is checked against the deal history, failed legs wait in a retry queue, and a plan is dropped if the book changes between the scan and the send.
9. The optional hedge cycle. Off by default. When enabled it holds a balanced pair on a symbol you choose and retires it in equal slices paid for by a small surcharge on closures the grid is already making.
The panel
The panel lives on the left and keeps the right side and the price scale free. It shows symbol and magic number, a status pill (ARMED, SCAN ONLY or PAUSED), grid mode, lot step, spacing, banked profit, the book in lots with its net result, the closing plan for each side with its own close button, the order list, an RVI PULSE row with the live main and signal values, their slope, the leading side and the bars since the last cross, and the RVI ZONE row with the zone, the trend filter state and the guard state. Buttons switch Armed / Scan only, Pause / Resume, chart marks and slicing. The Hedge Vault card docks right under the main panel and follows it when you drag or minimise. It scales to the screen and draws nothing in a non-visual backtest, so optimisation stays quick.
Safety in your hands
No stop loss and no forced close-all: when a limit is reached, new levels are refused while existing orders keep being managed.
Before every order the money check asks one honest question: is there enough free margin, with a buffer, for this order?
Caps 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.
On netting accounts the margin of the merged position is held within a percentage of equity.
Optional margin-level timeframe safety: when the margin level falls to the levels you set, the working timeframe steps up so signals come less often, and it steps back only after margin recovers past a hysteresis cushion. Off by default.
Each instance isolates itself by symbol and magic numbers, so several copies on different charts never touch each other's orders or saved state.
Scan only mode shows every decision on the panel without sending a single order.
Every setting explained
Grid - how levels are opened
Trade mode (TradeMode) - dual grid by default, BUY and SELL side by side, or a single direction.
Grid space between levels (GridSpacePoints) - fixed distance in points (25) when ATR spacing is not used.
Spacing multiplier per level (GridSpaceMultiplier) - 1.0 keeps levels even; higher values widen deeper levels.
Maximum levels per grid (MaxGridLevels) - upper bound on levels in one grid (1000).
Up move arms the BUY side (UpDirectionIsBuy) - decides which side an upward move belongs to.
Grid magic number (EAMagicNumber) - identifies this EA's orders (9754220).
Grid order comment (GridOrderComment) - text written on each grid order (GRVI).
One order per bar (OneOrderPerBar) - at most one new level per bar.
Lot ladder
Starting lot (InitialLotSize) - first level volume (0.01).
Lot sizing mode (LotSizingMode) - additive by default, or multiply.
Lot multiplier (LotMultiplier) - in multiply mode each level is the previous lot times this (1.25).
Lot add step (LotAddStep) - in additive mode the volume added per level (0.01; 0 means the starting lot).
Maximum lot per order (MaxOrderVolume) - hard ceiling for one order (1.0).
Auto lot (UseAutoLot) - scales the starting lot with balance (off).
Auto lot reference balance (AutoLotBaseBalance) - balance that matches the starting lot (1000).
Allow scaling down (AutoLotAllowDecrease) - lets auto lot fall below the starting lot (off).
ATR spacing
Spacing mode (GridSpacingMode) - ATR by default, or fixed points.
ATR timeframe and period (ATRTimeframe, ATRPeriod) - where and how volatility is measured (current chart, 14).
ATR spacing factor (ATRSpacingFactor) - distance equals ATR times this (1.0).
ATR bar shift (ATRBarShift) - 1 uses the last closed bar.
ATR floor and ceiling (ATRMinSpacingPts, ATRMaxSpacingPts) - minimum and maximum distance in points (50 and 5000; 0 means none).
Freeze ATR spacing (ATRFreezeOnStart) - keeps one distance for the whole cycle (off).
Profit target
Desired profit per closure (DesiredProfitPerClosure) - base target in account money (2.0).
Final profit multiplier (ProfitMultiplier) - scales the target between 1.00 and 2.00.
Profit target mode (ProfitTargetMode) - scaled by default, so larger and deeper books need a larger result.
Volume exponent (ProfitVolumePower) - how strongly closing volume raises the target (1.0; 0 turns it off).
Depth bonus (ProfitDepthBonus) - extra target per additional open level (0.10).
Maximum multiple (ProfitMaxMultiple) - ceiling on the scaled target as a multiple of the base (50).
Reach cap (ProfitMaxReachFraction) - keeps the target within a fraction of one grid step so it stays reachable (0.50).
Fragment scanner
Multi-leg scan (UseMultiLegScan) - tries combinations of several orders before the plain pair (on).
Oldest and newest legs (MaxOldestLegs, MaxNewestLegs) - group size limits (3 and 6).
Scan priority (ScanPriority) - ranks qualifying groups, most orders first by default.
Never bank less than the pair (NeverBankLessThanPair) - a group must also clear the plain pair target (on).
Closing volume must exceed target volume (RequireCloseVolumeExceedsTarget) - newest volume must outweigh the oldest (on).
Minimum closing to target volume ratio (MinCloseVolumeRatio) - 1.5.
Target slicing - partial closes
Enable slicing (EnableTargetSlicing) - closes a slice of the oldest order when the whole lot is out of reach (on).
Profit weight power (FragProfitWeightPower) - how profit is weighted per closing lot (1.5).
Smallest slice (FragMinSlicePercent) - minimum slice as a percent of the target order (20).
Several closers (FragAllowMultiCloser) - lets several newest orders combine to fund one slice (on).
Prefer full closure (FragPreferFullClosure) - a full closure always wins over a slice when both qualify (on).
Reopen guard
Reopen guard mode (ReopenGuard) - blocks closures that would immediately reopen a level (step based).
Guard cushion (ReopenGuardCushion) - safe distance as a fraction of one grid step (0.90).
Account protection
Minimum margin level (MinMarginLevelPercent) - blocks new levels below this margin level percent (0 = off).
Maximum floating loss (MaxAccountRiskPercent) - blocks new levels above this loss as a percent of balance (0 = off).
Netting margin cap (NetMaxMarginPercent) - maximum margin of the net position as a percent of equity (5.0).
Maximum orders per side (MaxTotalOrders) - absolute order cap (1000).
Execution and verification
Run mode (RunMode) - Armed or Scan only; Scan only is the gentle way to begin.
Leg send order (CloseSequence) - oldest first by default.
Maximum slippage (MaxSlippagePoints) - 30 points.
Maximum spread (MaxSpreadPoints) - trading pauses above this spread (7500 points).
Seconds between closures (MinSecondsBetweenClosures) - minimum pause between two closures on one side (5).
Attempts per leg (CloseAttemptsPerLeg) - sends before a leg moves to the retry queue (3).
Verify timeout (VerifyTimeoutSeconds) - how long a stuck leg keeps being checked (90 seconds).
Wait when the market is closed (DeferWhenMarketClosed) - waits for the session instead of halting (on).
Market closed retry (MarketClosedRetrySeconds) - retry interval while orders are refused (30 seconds).
Auto resume (AutoResumeAfterSeconds) - clears a halt after this many seconds (300; 0 waits for the panel).
Partial close retry (NoPartialRetryMinutes) - retries partial closes this many minutes after a broker refusal (15; 0 never).
Abort if the book changed (AbortIfBookChanged) - drops a plan if a leg changed between scan and send (on).
Full commission (UseFullCommission) - counts commission for both sides (on).
Commission per lot (CommissionPerLot) - fallback value when history has none (0 reads it from history).
Closing comment (CloseOrderComment) - text written on closing deals.
Hedge cycle
Enable hedge cycle (EnableHedgeCycle) - off by default.
Hedge symbols (HedgeSymbols) - comma-separated list; repeating a symbol gives it more turns (XAGUSD).
Symbol rotation (HedgeSymbolRotation) - how the next cycle symbol is chosen (per cycle).
Tester symbol cap (HedgeMaxSymbolsInTester) - limits rotation in the Strategy Tester only (2; 0 means no cap).
Cycle lots and slice lots (HedgeCycleLots, HedgeSliceLots) - lots per side and lots retired per slice (0.01 each).
Fragment bonus (HedgeFragmentBonus, HedgeBonusIsPercent) - extra amount on top of the slice cost, a percent by default (100).
Surcharge caps (HedgeMaxSurcharge, HedgeMaxSurchargePercent) - limits on how much one closure target may be raised (0 = no money cap, 50 percent).
Hedge magic number (HedgeMagicNumber) - must differ from the grid (9754221).
Reopen on finish (HedgeReopenOnFinish) - starts a fresh cycle when one ends (on).
Start requires a trade (HedgeStartRequiresTrade) - waits for the grid to open something first (on).
Integrity check interval (HedgeIntegritySeconds) - verifies both legs every few seconds (5).
Auto repair and naked leg action (HedgeAutoRepair, HedgeNakedAction) - repairs a lone leg by re-hedging (on).
Hedge execution controls (HedgeMaxSpreadPoints, HedgeSlippagePoints, HedgeAttemptsPerLeg, HedgeVerifyTimeout, HedgeCommissionPerLot, HedgeOrderComment) - spread, slippage, attempts, verify timeout, commission and comment for the hedge legs, mirroring the grid ones.
Weekly cash day
Weekly cash day (WeeklyCashDay) - no new hedge cycle and no slice over your withdrawal window (off).
Cash day of week (CashDayOfWeek) - 0 Sunday, 1 Monday and so on (1).
Cutoff hour (CashCutoffHour) - server hour after which no new slice is fired (21).
Panel and chart
Panel placement (ShowPanel, PanelX, PanelY, PanelFontSize, PanelCorner) - visibility, offsets, font size and corner of the panel.
Arabic line (ShowArabic) - adds an Arabic line under the English (on).
Chart marks (ShowChartMarks) - draws plans and levels on the chart (on).
Max table rows (MaxTableRows) - order rows shown per grid (13).
Entry trigger
Entry trigger mode (EntryTriggerMode) - the RVI strategy arms the first level by default.
Signal bar (SignalBarShift) - 1 means the last closed bar.
Bars between accepted signals (SignalBarsDelay) - 30 by default (0 accepts every signal).
Signal valid bars (SignalValidBars) - a signal stays usable for this many bars (3).
Allow BUY and allow SELL (SignalAllowBuy, SignalAllowSell) - enable each direction separately.
Reverse signal (SignalReverse) - inverts the direction (off).
Relative Vigor Index - the signal
RVI period (InpRVIPeriod) - averaging length of the vigor calculation (10).
Minimum gap (InpRVIMinGap) - required distance between the main and signal lines on the signal bar (0 = off).
Zone-Exit Guard (InpRVIZoneGuard) - a BUY cross must start at or below minus the zone level, a SELL at or above plus the level (on).
Zone level (InpRVIZoneLevel) - the zone boundary in RVI units; 0 uses the zero line, a small value such as 0.05 asks for a deeper turn (0.0).
Trend filter (InpRVITrendFilter) - 0 off, 1 trade with the EMA side, 2 trade against it as a fade.
Trend filter EMA period (InpRVITrendMAPeriod) - 200.
Signal arrows (InpShowSignalArrows) - marks candles where a signal armed a cycle (on).
Margin timeframe safety
Use margin TF safety (UseMarginTFSafety) - off by default.
Level 1 (Level1MarginPct, Level1TF) - at or below 6000 percent, work on M15.
Level 2 (Level2MarginPct, Level2TF) - at or below 5000 percent, work on H1.
Hysteresis (MarginTFHysteresisPct) - margin must recover this far above a level before stepping back (500).
Debug
Debug mode (DebugMode) - verbose journal logging (off).
Honest expectations
A grid manages a position; it cannot see what comes next. Grid Relative Vigor Index EA is selective about when a cycle begins and works steadily to keep each cycle short and each old order shrinking, yet a long one-way trend can still keep the book open for a while. Choose a lot your account can carry through that, test on your own broker first, and let the Strategy Tester show you its rhythm before you go live. It runs on any symbol and timeframe and needs no DLLs and no extra files.
If you try it, an honest review describing how it behaved on your account, good or bad, helps other traders make a better decision.
