Home / Coding / Expert Advisors / Grid the symbol

Grid the symbol

A capped smart grid that opens only in a ranging market and exits on the whole basket's gain.

DRF_Grid_EA · version 2.01 · Strategy · MetaTrader 5

€15   Buy Grid the symbol →

Or get every Expert Advisor, for life, for €150: see the bundle.

Risk. This Expert Advisor uses a method that can look steady for a long time and then produce a large loss. Trading carries a high level of risk and you can lose more than you expected. No result is promised. Read the Risk Disclosure.

Test it on a demo account first. When everything works as you expect, use it on a real account.

It works on any symbol: point-based inputs scale to the symbol you attach it to.

Who it suits

Experienced traders who understand basket risk and want a capped, regime-aware grid.

What it does

A grid for sideways the market. It will not open a grid in a trend (the ADX must be low and the bands narrow), spaces its levels by the ATR, caps the number of levels and closes the whole basket on a cash target with trailing.

How it works

  1. Regime filter: ADX at or below 25 plus a narrow Bollinger band; if the ADX cannot be read, it assumes a strong trend and does not trade.
  2. Spacing: ATR times 1.2 between levels, progressive lot sizing and a hard cap of 6 levels, so the size never grows without limit.
  3. Exit: a basket cash target with trailing on the whole set, and a defensive close if adverse news hits while the basket is losing.
  4. Filters: session 03:00 to 21:00, spread cap 350 points, MetaTrader calendar news filter.

What is included

What is not included

What you need

How to try it

  1. Attach it to a demo chart on the timeframe you want to test.
  2. Set a small lot size (0.01) and leave the other inputs at their defaults.
  3. Read the Experts and Journal tabs and the on-chart panel for the reasons it gives when it skips an entry.
  4. Move to a small live account only after you have seen it behave as expected on demo.

Results

No results are published for this Expert Advisor, and none are implied. Test it on a demo account first. Past results never promise future ones.

Buy once, keep it for life

€15   Buy Grid the symbol →

Manual: every setting in plain language

Enter your DRF Key in the key input. The group "Any-asset scaling" controls how point inputs follow the symbol.

Donaldson R F Licence

InpLicenceKey (default: (empty))
Licence key

Identification

InpMagicNumber (default: 770001)
Magic number
InpTradeComment (default: DRFGrid)
Text written in the comment field of each order.

Market regime (grid entry filter)

InpADX_Period (default: 14)
ADX period (trend strength).
InpADX_MaxToGrid (default: 25.0)
Maximum ADX allowed to open a grid (ranging market)
InpBB_Period (default: 20)
Bollinger Bands period.
InpBB_Deviation (default: 2.0)
Bollinger Bands width, in standard deviations.
InpBB_MaxWidthATR (default: 3.0)
Maximum band width, in ATR multiples, to still call it a range

Spacing and lot sizing

InpATR_Period (default: 14)
Number of bars in the Average True Range (ATR).
InpATR_SpacingMult (default: 1.2)
Distance between levels = ATR x this factor
InpBaseLot (default: 0.01)
Order size in lots for the first order.
InpLotMultiplier (default: 1.4)
Lot progression factor per level
InpMaxLevels (default: 6)
Hard cap on levels (the lot size can never grow without limit)

Basket management (smart exit)

InpBasketTargetUSD (default: 15.0)
Floating gain at which the basket becomes eligible to lock in
InpTrailingStartUSD (default: 15.0)
Floating gain at which trailing is armed
InpTrailingStepUSD (default: 5.0)
Pullback in USD from the peak that closes the whole basket
InpMaxBasketLossUSD (default: 80.0)
Defensive hard stop for the basket

News filter (native MT5 calendar)

InpUseNewsFilter (default: true)
Pause new entries around scheduled news, using the MetaTrader 5 economic calendar.
InpNewsMinutesBefore (default: 30)
How many minutes before a qualifying news release new entries are blocked.
InpNewsMinutesAfter (default: 30)
How many minutes after a qualifying news release new entries stay blocked.
InpNewsMinImportance (default: CALENDAR_IMPORTANCE_HIGH)
The lowest calendar importance that counts as news for the filter (high, medium or low).
InpCloseOnAdverseNews (default: true)
Consider a defensive cut when high-impact news goes against the basket
InpAdverseNewsMaxLossUSD (default: 40.0)
Only cut on news once the basket loss already exceeds this

Spread filter

InpUseSpreadFilter (default: true)
Switch the spread filter on or off.
InpMaxSpreadPoints (default: 350)
Maximum spread, in points, to allow new/expanded orders

Session filter

InpUseSessionFilter (default: false)
Switch the trading-hours filter on or off.
InpSessionStartHour (default: 3)
Server time
InpSessionEndHour (default: 21)
Hour of the day (server time) at which new entries stop.

Any-asset scaling

InpAutoScalePoints (default: true)
Scale point-based inputs to this symbol's volatility (default values are tuned for a ~3000-point daily range) Leave on unless you know the symbol is much calmer or wilder than the usual daily range.

Related Expert Advisors

Oscillator Reversal

A classic oscillator confluence: RSI at an extreme with a Stochastic cross, closed at the Bollinger middle band.

Open →

Reversal Scalper

An M1 exhaustion scalper: a poke past the Bollinger Band in a quiet market, with RSI turning and a rejection candle.

Open →

Frequently Asked Questions

Does it keep raising the lot size?
It raises the lot size step by step, but with a hard cap on levels, so the size can never grow without limit.
What stops it opening in a trend?
A high ADX or wide bands.
What is the exit?
The whole basket's cash target, with trailing.
Do I need a DRF Key to run it?
Yes. The file is free to download, but the EA checks a DRF Key against the licence server when it starts and then every hour. Plans and prices are on the DRF Key page.
Which provider and account should I use?
Any MetaTrader 5 account that offers the symbol. Test on a demo account first; the source does not tie the EA to one provider.
Does it guarantee a result?
No. Trading carries risk and an EA can lose money. The project holds no published performance figures for this EA, so none are shown.
Which symbols does it work on?
Any symbol your provider offers. Inputs that are measured in points scale automatically to the symbol's usual daily range, so the same preset behaves sensibly on a forex pair, an index or Bitcoin. Always test on a demo account first.
Do I need a key to run it?
Yes. After you buy, you receive a DRF Key. It works for life and on up to 5 internet addresses at the same time.
Is there a subscription?
No. You pay once and keep it for life, with free updates.
Does it promise a result?
No. Read the Risk Disclosure. Test on a demo account first; when everything works as you expect, use it on a real account.

Get Expert Advisor and coding news

New Expert Advisors, updates, price changes and videos, by e-mail. A short e-mail only when something is really new. One click to unsubscribe.

You get one e-mail to confirm first. By subscribing you agree that I use your address to send this newsletter. See the Privacy Policy.

Protected by Google reCAPTCHA. The Google Privacy Policy and Terms of Service apply.

Running into a technical issue or something that doesn't work right on this page? Please let us know straight away via our Contact page. That is how we find out what is broken and get it fixed.