Drawdown Controlled Two Sided Grid
- Experts
- Versione: 2.2
- Attivazioni: 10
Drawdown Controlled Two-Sided Grid is an automated Expert Advisor for MetaTrader 5.
IMPORTANT RISK NOTICE
This EA uses a grid / multi-trade technique and can keep many trades open in the same direction without a stop loss on each trade. A basket can show a large floating loss and a long drawdown before it recovers. Position size and the number of open trades can grow. Past or simulated results do not guarantee future results. Test on a demo account first and only risk money you can afford to lose.
How it works
- You set the drawdown you accept and a reference balance; the EA calculates the lot, the grid step and the basket target from that drawdown and the recent daily range.
- Direction comes from Darvas boxes on D1, H4, H1 and M5 (five-zone score). The EA trades the trend side and tilts the lot ratio toward the winning side; the ratio can swap sides automatically.
- Protection: hard drawdown stop (closes everything when the floating loss reaches the target drawdown), basket close when total profit reaches the target, and split close (profits of the winning side are used to close losing trades).
- On-chart control dashboard with editable values and the Darvas boxes drawn on the chart.
Safety and broker compatibility
- Volume is normalized to the symbol minimum, maximum and step before every order.
- Free margin is checked with OrderCalcMargin before an order is sent.
- Stops level and freeze level are respected when placing or modifying orders and SL/TP; a modification is not sent when the values are unchanged and nothing is modified inside the freeze zone.
- Symbol trade mode, trading session, order limit and filling mode are checked before sending requests.
- No DLL, no web requests, no files are written.
BOTKRIT recovery core and dashboard
This build includes a basket recovery core and a standard BOTKRIT panel. When the open basket of this EA loses more than the set percentage of the balance the EA pauses its own new entries and the core can open balancing (hedge) trades with its own magic number until the basket can be closed at break-even plus a target; the basket is cut at the set loss percentage. Balancing trades can increase exposure. The core works on hedging accounts only and can be switched off with InpRKOn = false. The panel can be collapsed and moved to another corner.
Inputs
- InpDDTarget (default 10.0): Ddtarget
- InpRefBalance (default 0): Ref balance
- InpRatioBuy (default 58): Ratio buy
- InpHardDDStop (default true): Hard ddstop
- InpSurviveATRday (default 3.0): Survive atrday
- InpTrendFilter (default true): Trend filter
- InpHarvestAll (default true): Harvest all
- InpHarvestPct (default 1.0): Harvest pct
- InpDeRiskOn (default true): De risk on
- InpKeepTopPct (default 20): Keep top pct
- InpRecyclePct (default 50): Recycle pct
- InpMinBookSplit (default 6): Min book split
- InpSplitTrigFrac (default 0.35): Split trig frac
- InpGridAuto (default true): Grid auto
- InpGridManualPts (default 300): Grid manual pts
- InpATRperiod (default 14): ATR period
- InpGridDivisor (default 6.0): Grid divisor
- InpMaxOrders (default 400): Max orders
- InpUsePerPosTP (default false): Use per pos tp
- InpRangeBars (default 12): Range bars
- InpMTFEntry (default true): Mtfentry
- InpZoneTh (default 0.5): Zone th
- InpSlippagePts (default 20): Slippage pts
- InpMagic (default 887788): Magic number
- InpMaxSpreadPts (default 150): Max spread pts
- InpShowPanel (default false): Show panel
- InpDrawGauge (default true): Draw gauge
- InpBoxHistory (default true): Box history
- InpBackDays (default 30): Back days
- InpBoxMaxPerTF (default 600): Box max per tf
- InpBoxBigBars (default 50): Box big bars
- InpCtrlPanel (default true): Ctrl panel
- InpPanelRight (default false): Panel right
- InpCtrlMargin (default 12): Ctrl margin
- InpApplyTheme (default true): Apply theme
- InpHideGrid (default true): Hide grid
- InpHideVolume (default true): Hide volume
- InpCandleBull (default C'25,158,112'): Candle bull
- InpCandleBear (default C'217,89,38'): Candle bear
- InpChartBg (default C'13,13,13'): Chart bg
- InpBoxColD1 (default C'80,150,235'): Box col d1
- InpBoxStyD1 (default STYLE_SOLID): Box sty d1
- InpBoxWidD1 (default 3): Box wid d1
- InpBoxColH4 (default C'205,110,215'): Box col h4
- InpBoxStyH4 (default STYLE_SOLID): Box sty h4
- InpBoxWidH4 (default 2): Box wid h4
- InpBoxColH1 (default C'80,195,205'): Box col h1
- InpBoxStyH1 (default STYLE_SOLID): Box sty h1
- InpBoxWidH1 (default 1): Box wid h1
- InpBoxColM5 (default C'170,165,150'): Box col m5
- InpBoxStyM5 (default STYLE_DOT): Box sty m5
- InpBoxWidM5 (default 1): Box wid m5
- InpHistDirColor (default false): Hist dir color
Recovery core and dashboard inputs:
- InpRKOn (default true): Recovery core on/off: when the basket loss grows, new entries of the EA are paused and balancing trades can be opened until the basket closes
- InpRKStartPct (default 3.0): Start recovery when the basket loss exceeds this percent of the balance at basket start
- InpRKStartATR (default 3.0): or when price runs against the net position by this many ATR (0 = off)
- InpRKCutPct (default 30.0): Close the whole basket at this percent loss of the start balance
- InpRKShockATR (default 10.0): Shock distance to survive (ATR multiples), used for the lot ceiling
- InpRKMinMargin (default 300.0): Do not open a recovery trade if the margin level after opening would be below this percent
- InpRKSpreadMul (default 2.0): Pause recovery trades when the spread is above this multiple of the 60-minute median
- InpRKCorner (default bottom right): Corner of the BOTKRIT panel
- InpRKBar0 (default FULL): Bar-0 label (basket profit, spread and leverage)
Recommended setup
- Gold and major forex pairs. The dashboard shows the suggested balance for the chosen drawdown.
- Minimum capital: Use the capital shown in the dashboard (suggested balance); the default needs several thousand USD.
- Test on a demo account first and keep the lot small.
