Dual Side Pending Grid
- Experts
- Versione: 3.0
- Attivazioni: 10
Dual Side Pending 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
- Builds a ladder of Buy Stop and Sell Stop orders around the price. The distance between levels comes from fast and slow ATR (several expansion modes).
- Lots per level are divided by a lot list, adjusted for volatility and limited by a margin budget per side; pending orders are re-allocated when the exposure changes.
- Profit slicing (off by default) offsets losing trades with winners.
- A cycle closes at the net profit target, by trailing or at break-even; loss per cycle and drawdown percent limits stop the cycle; Friday close is available.
- The chart shows the grid, open trades, a report panel and a cycle summary.
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
- InpTF (default PERIOD_M5): Tf
- InpStartMode (default START_IMMEDIATE): Start mode
- InpAnchor (default GRID_AT_PRICE): Anchor
- InpRefreshOnBar (default true): Refresh on bar
- InpATRFast (default 14): Atrfast
- InpATRSlow (default 96): Atrslow
- InpStepSource (default STEP_SRC_ATR): Step source
- InpFixedStep (default 1.00): Fixed step
- InpATRMult (default 2.00): Atrmult
- InpRegimeAdapt (default true): Regime adapt
- InpRegimePower (default 0.50): Regime power
- InpRegimeMin (default 0.60): Regime min
- InpRegimeMax (default 2.50): Regime max
- InpCurve (default CURVE_EQUAL): Curve
- InpCurveK (default 1.08): Curve k
- InpFirstOffsetMult (default 1.00): First offset mult
- InpMinGap (default 3.00): Min gap
- InpMaxGap (default 8.00): Max gap
- InpLevels (default 4): Levels
- InpBaseLotMode (default BASE_FIXED): Base lot mode
- InpBaseLot (default 0.01): Base lot
- InpEquityPerBase (default 1000.0): Equity per base
- InpWeightMode (default WEIGHT_AUTO): Weight mode
- InpMultiplier (default 1.0): Multiplier
- InpMultLevels (default 9): Mult levels
- InpJumpLot (default 0.0): Jump lot
- InpAddLot (default 0.0): Add lot
- InpCustomLots (default 0.01,0.02,0.04,0.08,0.16,0.32,0.64,1.28,2.56,5,10): Custom lots
- InpRepeatLastLot (default true): Repeat last lot
- InpVolLotAdapt (default true): Vol lot adapt
- InpVolLotPower (default 1.0): Vol lot power
- InpVolLotMin (default 0.50): Vol lot min
- InpVolLotMax (default 1.50): Vol lot max
- InpRecovery (default false): Recovery
- InpRecoverySteps (default 3.0): Recovery steps
- InpRecoveryWeight (default 1.0): Recovery weight
- InpRecoveryMaxMult (default 3.0): Recovery max mult
- InpMarginBudgetPct (default 50.0): Margin budget pct
- InpMaxSideLots (default 0.0): Max side lots
- InpReallocWindow (default 4): Realloc window
- InpReallocMinPct (default 25.0): Realloc min pct
- InpMaxLotPerOrder (default 50.0): Max lot per order
- InpUseSlicing (default false): Use slicing
- InpSliceMinUSD (default 1.50): Slice min usd
- InpSliceOnlyInDD (default true): Slice only in dd
- InpOffsetKeepUSD (default 0.20): Offset keep usd
- InpOffsetMinPos (default 3): Offset min pos
- InpOffsetMaxLosers (default 2): Offset max losers
- InpOffsetCooldown (default 15): Offset cooldown
- InpCloseMode (default CLOSE_FAST): Close mode
- InpTakeProfitUSD (default 12.0): Take profit usd
- InpScaleMoneyByLot (default true): Scale money by lot
- InpTrailStartUSD (default 0.0): Trail start usd
- InpTrailStepUSD (default 1.0): Trail step usd
- InpBEAfterPositions (default 0): Beafter positions
- InpBEAfterMinutes (default 0): Beafter minutes
- InpBETargetUSD (default 0.5): Betarget usd
- InpUseRealComm (default true): Use real comm
- InpRealCommFactor (default 2.0): Real comm factor
- InpCommissionPerLot (default 0.0): Commission per lot
- InpLockClose (default false): Lock close
- InpMaxLossUSD (default 150.0): Max loss usd
- InpMaxDDPercent (default 30.0): Max ddpercent
- InpPauseAfterStop (default true): Pause after stop
- InpDailyTargetUSD (default 0.0): Daily target usd
- InpDailyLossUSD (default 0.0): Daily loss usd
- InpMaxSpread (default 0.50): Max spread
- InpMaxRegime (default 0.0): Max regime
- InpUseHours (default false): Use hours
- InpStartHour (default 1): Start hour
(+ 19 more inputs, see the Inputs tab; every input has a description.)
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 pairs, M5 chart.
- Minimum capital: At least 3,000 USD for the default custom lot ladder; reduce the lot list for smaller balances.
- Test on a demo account first and keep the lot small.
