Skip to content
All strategies

Strategies

BBRSI (geraked, MT5) faithful port on gold: BB(500,2)+RSI(7) band re-entry reversal with 1.1x averaging grid and 50% trailing stop, long-short, XAUUSDT.BINANCE 5m

Outcome: Abandoned

BbRsiGoldGridPortLS

Outcome Summary

BbRsiGoldGridPortLS was submitted at the user's request as a faithful translation of the BBRSI MT5 expert onto Binance's gold perpetual (5m bars, about 9.5 months of history). The hypothesis itself noted that the default averaging/martingale grid belongs to a family that earlier lessons report as dead, and it pre-registered a grid-OFF variant as the only form considered potentially viable. The strategy never got through coding: after 2 iterations the pipeline abandoned it with 'coding_stuck_3_timeouts'. No backtest, optimization or analyst verdict was produced, so the idea itself was never tested.

Hypothesis

Faithful translation of the MIT-licensed MT5 expert 'BBRSI' v1.6 by geraked (https://github.com/geraked/metatrader5, Experts/BBRSI.mq5; order handling from Include/EAUtils.mqh GerEA). All credit goes to the author. The author built it for XAUUSD 5M (2021-02-26 to 2023-09-15). Our closest tradable gold instrument is the Binance USD-M gold perpetual XAUUSDT.BINANCE on 5-MINUTE bars. Its catalog history starts 2025-12-11, so about 9.5 months and about 80k bars are available. Indicators are computed on closed bars……Show moreShow less

Faithful translation of the MIT-licensed MT5 expert 'BBRSI' v1.6 by geraked (https://github.com/geraked/metatrader5, Experts/BBRSI.mq5; order handling from Include/EAUtils.mqh GerEA). All credit goes to the author. The author built it for XAUUSD 5M (2021-02-26 to 2023-09-15). Our closest tradable gold instrument is the Binance USD-M gold perpetual XAUUSDT.BINANCE on 5-MINUTE bars. Its catalog history starts 2025-12-11, so about 9.5 months and about 80k bars are available. Indicators are computed on closed bars only: Bollinger Bands on close (period BBLen=500, deviations BBDev=2.0, shift 0, SMA mid with population std like MT5 iBands) and RSI on close (RSILen=7, Wilder smoothing like MT5 iRSI). Fixed constants: RSILower=30, RSIMiddle=50, RSIUpper=70. The logic runs once per new bar. Index [1] is the last closed bar and [2] is the bar before it. The EA is a band-re-entry reversal: a bar closes outside the band with RSI at an extreme, then the next bar closes back inside the band, on the same side of the mid, with RSI back across the 30/70 line. It enters toward the mid. By default the EA sends no hard SL or TP (IgnoreSL=true, IgnoreTP=true). Exits are handled by two things: (a) a trailing stop at TrailingStopLevel=50% of the original stop distance, and (b) a martingale-style averaging GRID (Grid=true, GridVolMult=1.1, GridMaxLvl=20, GridTrailingStopLevel=0). The grid adds positions every 'stop distance' against the trade and closes the whole basket at a common take-profit that recovers the first position's stop-distance loss plus costs. Other defaults as written: CloseOrders=false (so the mid-band exit in CheckClose is INACTIVE by default); CloseOnProfit=true; Reverse=false; Risk=1.0 with RISK_DEFAULT; EquityDrawdownLimit=0 (disabled); News=false; OpenNewPos=true; MultipleOpenPos=false; MarginLimit=300; SpreadLimit=-1 (disabled); SLDev=0; TPCoef=1; SLCoef=0.9. The port stays faithful, but read the policy notes. The default configuration is an averaging/martingale grid, the inventory family that lesson L171 reports as 5/5 dead, and the source is a public-library port, the family covered by L167. We submit it because the user asked for a faithful statement. The Analyst should read the result as a test of the source as written. A grid-OFF variant (Grid=false, with the stated trailing/stop behaviour) is PRE-REGISTERED as a second, separately scored variant, and it is the only form we consider potentially viable. Flat state: the book is flat whenever no basket is open. The EA holds at most one basket (Grid || !MultipleOpenPos means no new signal while any position is open). We expect it to be flat about 65-80% of the time.

Every input is ported at its default. BB is an SMA mid with population std (MT5 iBands). RSI uses an SMA seed then Wilder smoothing (MT5 iRSI). Indices [1]/[2] map to the current and previous closed 5m bars, and the logic is evaluated once per bar close. The entry fills at market (Ask/Bid approximated by the bar close). The same side-guard applies: no new signal while a basket is open (Grid || !MultipleOpenPos). CheckClose (CloseOrders=false), Reverse, IgnoreSL and IgnoreTP are implemented behind their……Show moreShow less

Every input is ported at its default. BB is an SMA mid with population std (MT5 iBands). RSI uses an SMA seed then Wilder smoothing (MT5 iRSI). Indices [1]/[2] map to the current and previous closed 5m bars, and the logic is evaluated once per bar close. The entry fills at market (Ask/Bid approximated by the bar close). The same side-guard applies: no new signal while a basket is open (Grid || !MultipleOpenPos). CheckClose (CloseOrders=false), Reverse, IgnoreSL and IgnoreTP are implemented behind their default-off switches. The GerEA trail/grid/basket-TP bookkeeping follows the repo's earlier GerEA port (NWERSIASFGridBasketOkx) and is kept as plain scalar attributes so a restart restores it. Platform adaptations: (1) MT5's 30s OnTimer is replaced by per-5m-bar maintenance plus venue-resting stop/limit orders, which trigger intra-bar. (2) MT5 'not enough money' rejections become a margin-room check: open notional must stay <= equity x config.leverage x 0.95. Leverage is 10x, like a leveraged gold CFD account, and a grid add that would breach it is skipped. MarginLimit=300% is redundant with the one-basket rule on a single symbol, so it is not coded separately. (3) News, SpreadLimit and EquityDrawdownLimit are disabled by default in the source and are omitted. (4) The 30-point minimum stop distance uses the instrument tick of 0.01, matching XAUUSD points. Per-bar cost is O(500) (one BB std over a fixed deque), independent of the backtest span. Honest note: the default is a martingale averaging grid. Its losses show up as deep-grid basket drawdowns, not as the frequent small wins. The grid=false variant is the one the hypothesis pre-registers as potentially viable.

coding_stuck_3_timeouts

Implementation

Faithful port of geraked's MIT BBRSI v1.6 (MT5) on the Binance gold perpetual, 5m bars. It enters toward the mid-band after a band re-entry reversal. The signal needs a bar that closes outside BB(500,2) with RSI(7) beyond 30/70, then a bar that closes back inside the band, on the same side of the mid, with RSI back across 30/70. Size is Risk=1% of balance per original stop distance. The stop distance is |entry - (band - 0.9 x (mid-to-band width))|. No hard SL/TP is sent (IgnoreSL/IgnoreTP). Exits come from GerEA's machinery. A single leg gets a 50%-of-stop-distance trailing stop that rests at the venue as a reduce-only STOP_MARKET. The averaging grid adds 1.1x the largest leg every stop distance against the trade, up to 20 legs, as resting limits. Once two or more legs are open, the whole basket closes at a resting take-profit limit that recovers first_qty x stop_distance plus fees. At most one basket is open at a time. The grid-OFF pre-registered variant is parameters.grid=false; set ignore_sl=false to also send the hard stop.

Iteration History

sandbox_timeout: Verification failed (Layer 3 — sandbox backtest): smoke test exceeded the 300s wall-clock limit on a ~20000-bar window (69 days of XAUUSDT.BINANCE-5-MINUTE-LAST-EXTERNAL). This almost always means per-bar work that scales with history — e.g. rescanning the full funding/supplementary series, or rebuilding a list and calling min()/sorted() inside calculate_signal()/on_bar() on every bar. Precompute sorted timestamp arrays ONCE in __init__ and use bisect, or cache lookups keyed by timestamp, so per-bar cost is O(log n) not O(n).

Outcome Summary

A full port of an EA's order-handling layer (grid baskets, trailing stops, basket take-profits) can be too complex to code within the time limit, so a simpler first version, such as the pre-registered grid-OFF variant, has a better chance of reaching a backtest.

The run was abandoned at the coding stage with reason 'coding_stuck_3_timeouts' after 2 iterations. Verification, backtesting, optimization and analysis were never reached.

A faithful port of geraked's MIT-licensed MT5 'BBRSI' v1.6 EA to XAUUSDT.BINANCE 5m. It trades long and short on Bollinger(500,2) band re-entry reversals toward the mid, confirmed by RSI(7) crossing back over 30/70, and manages exits with a 50% trailing stop and a 1.1x averaging grid (up to 20 levels) that closes the whole basket at a common take-profit.

No performance data exists: the backtest report is empty, there is no optimization report, and no backtest-review, analyst or risk verdict was recorded.

Analysis

BBRSI

Backtest and paper results are hypothetical. Trading involves risk of loss.