KAA BB Grid
- Experts
- Version: 2.0
- Activations: 5
KAA BB Grid is a basket grid Expert Advisor for MetaTrader 5. It opens the first trade at the edge of the Bollinger Bands, only in the direction of the higher-timeframe trend. It adds positions at ATR-based distances and closes the whole basket together at a profit target that grows with the basket.
The EA was designed for XAUUSD (Gold) and also works on other symbols, because all distances are set in points or come from ATR.
How it works
- Trend filter – An EMA on a higher timeframe (default EMA 200 on H1) sets the direction. Buy baskets start only above a rising EMA, and sell baskets only below a falling EMA.
- First entry – A buy basket starts when price touches the lower Bollinger Band. A sell basket starts when price touches the upper band. An optional candle body filter is available.
- Grid – When price moves against the basket, a new level is added. The distance is ATR × multiplier, with a minimum (and optional maximum) in points. The lot can grow by a multiplier per level, up to a max lot cap.
- Exit – The whole basket closes together when it reaches the profit target. With the dynamic target on, the target rises with the number of levels and the total lot.
Main features
- Bollinger Bands entry with an EMA trend and slope filter
- ATR adaptive grid step (min / max distance in points)
- Dynamic basket take profit that scales with basket size
- 4 close modes: basket profit, basket points, BB middle band, opposite BB band
- Basket trailing profit (fixed, or scaled to the target)
- Fixed lot or automatic lot by balance
- Money targets can scale with the lot size, so one set file fits different deposits
- Equity drawdown protection in % or money, with automatic close of all baskets
- Spread filter, trading hours filter, Friday close
- One basket at a time option, and a cooldown after a basket closes
- Optional lot splitting into smaller orders (hedging accounts)
- Works on hedging and netting accounts
- Checks volume, free margin, symbol trade mode and broker limits before every order
- Information panel on the chart
Recommendations
- Symbol: XAUUSD (Gold)
- Chart timeframe: any. The EA uses its own signal timeframe (default M15).
- Minimum deposit: 1,000 USD for every 0.01 start lot
- Account: low spread (ECN / Raw), hedging preferred
- Run 24/5 on a VPS
- For 3-digit gold quotes (for example 2345.678), multiply the point inputs by 10
Input parameters
General
- Magic number – ID of the EA's orders. Use a different number on each chart.
- Order comment prefix – text added to the order comment
- Show info panel – show or hide the chart panel
Bollinger Bands
- BB period / deviation / applied price – Bollinger Bands settings
- Signal timeframe – timeframe for Bollinger Bands, ATR and new bar entries (default M15)
Trend Filter
- Use trend filter – trade only in the direction of the higher-timeframe EMA
- Trend timeframe / EMA period – default H1 / 200
- Require EMA slope – the EMA must also be rising (buy) or falling (sell)
Entry
- First order only at BB band – start a basket only at the band
- Allowed distance inside the band – tolerance in points
- Min candle body – minimum body of the last closed candle in points (0 = off)
Grid
- Grid direction – buy only, sell only, or both
- Max grid levels – maximum number of levels per basket
- One basket at a time – do not run buy and sell baskets together
- Cooldown bars – bars to wait after a basket is closed
- Grid step (points) – fixed step, or the minimum step when ATR is used
- Use ATR grid / ATR period / ATR multiplier – adaptive step settings
- Max adaptive step – upper limit in points (0 = no limit)
Lot Size
- Lot mode – fixed start lot, or automatic by balance
- Fixed start lot – first order lot in fixed mode
- Auto lot per step / balance step – for example 0.01 lot per 1,000 of balance
- Lot multiplier – lot growth per level (1.0 = same lot)
- Max lot – maximum lot of one order
- Max margin usage % – the most free margin one order may use
Lot Split (hedging only)
- Use lot split / split lot size / max split orders – open each level as several smaller orders, one per bar
Basket Exit
- Close mode – basket profit, basket points, BB middle band, or opposite band
- Basket profit target – money target
- Basket points target – target for points mode
- Also close at BB middle – extra exit when the basket is in profit
- Min profit to allow BB close – money
- Scale money values by start lot / Reference lot – money inputs are set for the reference lot and scale with your actual start lot
Dynamic Profit Target
- Use dynamic target – raise the target as the basket grows
- Extra target per level / per 1.0 lot – how much the target grows
- BB close target ratio – part of the target needed before a BB close
Basket Trailing
- Enable trailing – lock in basket profit
- Activation / step / distance – money values
- Dynamic trailing and ratios – set the trailing values as a ratio of the basket target
Risk Management
- Max drawdown % / money – equity drawdown limit (0 = off)
- Close all on max drawdown – close all baskets when the limit is hit. If off, no new orders are opened while drawdown is above the limit.
- Max spread – in points (0 = off)
Time Filter
- Use time filter / start hour / end hour – server time window for new orders
- Close on Friday / Friday close hour – close all baskets before the weekend
Before you start
- Test the EA in the Strategy Tester and on a demo account with your broker before trading live.
- Start with a small lot and keep the drawdown protection on.
Risk warning
This EA uses grid and lot multiplier techniques. In a strong one-way market, the open basket can build a large floating loss before it recovers or reaches the drawdown limit. Past performance does not guarantee future results. Trade only with money you can afford to lose.
