BKT Adaptive RSI EA
- Experts
-
Khac Thanh Bui
Turning trading logic into algorithmic precision. I develop professional-grade tools for FX and Gold, bridging the gap between practical trading needs and high-end software development.
WHAT I BUILD: - Version: 1.171
- Updated: 6 August 2026
BKT Adaptive RSI EA
A multi-strategy RSI trading system for MetaTrader 5 that combines a classic mean-reversion entry with optional divergence and failure-swing confirmation, managed through an averaging position model with a profit-lock exit.
BKT Adaptive RSI EA is an automated trading system built around the Relative Strength Index. It offers five selectable internal smoothing methods plus an optional second smoothing layer on top of the RSI output, allowing the same core logic to behave more like a classic oscillator or a slower, filtered signal line. Trade management is handled through an averaging model: if price moves against an open position, the EA can add further orders at a wider distance, and the resulting basket is closed either at a fixed profit target or through a trailing profit-lock. The EA requires a hedging account, since buy and sell positions are tracked as independent baskets.
Overview
The base strategy looks for RSI leaving an oversold or overbought zone: a buy signal forms when RSI crosses back above the oversold level after dipping below it, and a sell signal forms symmetrically at the overbought level. An optional filter can require RSI to reach a deeper extreme before the cross is treated as valid, reducing signals from shallow moves near the threshold. When a position is open and price continues against it, the EA can add further orders once a minimum adverse distance is reached and a new signal appears in the same direction. Additional order size grows either by a fixed increment or by a multiplier, up to a maximum number of orders per direction. A single open position closes at its own fixed profit target. Once more than one position is open, the basket switches to a trailing profit-lock: it arms at a set floating profit level, then closes the whole basket once profit pulls back a defined amount from its peak. Individual orders do not use a stop loss; risk is controlled through the maximum order count and lot sizing instead.
Key Features
- Five RSI smoothing engines: Wilder, SMA, EMA, LWMA, or a multi-pass RSX-style calculation, each with a different balance of responsiveness and smoothness.
- Optional second smoothing layer: an additional moving average applied on top of the RSI output for a slower signal line.
- Deep extreme filter: requires RSI to reach a deeper level before a reversal signal is accepted.
- Two independent add-on strategies: a divergence module comparing price swings against RSI, and a failure-swing module based on RSI's own swing structure, each managing its own positions.
- Flexible position sizing: additional orders grow by a fixed increment or by a multiplier.
- Pooled profit target: floating profit from every active strategy can optionally be combined into one shared target.
- On-chart panel: shows RSI value, position counts, floating profit, and profit-lock status.
How It Works
On each newly completed bar, the EA recalculates RSI and checks the entry condition of the base strategy and any additional strategy that has been enabled. When a signal appears and no position is open in that direction, an initial order is placed. While a position is open, price is monitored every tick; the position or basket is closed once its profit target is reached, or once an armed trailing profit-lock pulls back from its peak. If price moves further against an open position, the EA checks whether the conditions for an additional averaging order are met.
Recommended Settings
The RSI is calculated on a timeframe chosen independently of the chart it runs on, so the signal can be tuned separately from the execution chart. Because the averaging model can open several positions in the same direction, results vary between symbols with different volatility and spread, so testing on the target instrument first is recommended. Since individual orders have no stop loss, sufficient free margin should be available for the maximum number of averaging orders configured.
Input Parameters
RSI Settings — Timeframe, period, and applied price for the RSI calculation; internal smoothing method (Wilder, SMA, EMA, LWMA, or RSX-style); optional second smoothing layer with its own method and period; overbought and oversold levels; optional deep-extreme filter with its own threshold levels.
Entry and Averaging — Enable buy and sell directions independently; initial lot size; lot sizing mode (fixed increment or multiplier) for additional orders; minimum adverse distance, in points, before the next order; maximum number of orders per direction.
Take Profit — Profit target for a single open position; floating profit level that arms the basket trailing profit-lock; pullback distance from peak profit that closes the basket; option to pool every active strategy into one shared profit target.
Strategy Selection — Independent enable switches for the divergence strategy and the failure-swing strategy, each with its own swing-detection settings.
Filters and Display — Maximum spread filter for new entries; maximum slippage on order execution; option to show the on-chart information panel.
This EA manages losing positions by adding further orders rather than by using a stop loss on individual trades. The trailing profit-lock and maximum order limit are designed to manage the resulting basket, but a strong sustained move against an open position can still produce a large floating loss before it recovers. Position sizing and the maximum order count should be set according to the account's available margin.
