Multi-Oscillator Momentum Filtered Mean Reversion Bitcoin Trading Strategy

RSI WT STOCH RSI MEAN REVERSION OSCILLATOR SCALPING FIBONACCI momentum
Created on: 2025-08-15 12:00:17 Modified on: 2025-08-15 12:00:17
Copy: 0 Number of hits: 287
avatar of ianzeng123 ianzeng123
2
Follow
319
Followers

 Multi-Oscillator Momentum Filtered Mean Reversion Bitcoin Trading Strategy  Multi-Oscillator Momentum Filtered Mean Reversion Bitcoin Trading Strategy

Overview

The “Multi-Oscillator Momentum Filtered Mean Reversion Bitcoin Trading Strategy” is a quantitative approach specifically designed for Bitcoin short-term trading. It cleverly combines RSI Bands, WaveTrend indicator, and Stochastic RSI to form a multi-layered filtering system. The core of this strategy leverages price reversion to RSI Bands, while using WaveTrend and Stochastic RSI as confirmation filters to ensure high-probability trades in overbought and oversold areas. The strategy operates on a 1-minute timeframe for high-frequency scalping and is equipped with flexible take-profit/stop-loss mechanisms and position reversal capabilities.

Strategy Principles

The strategy works based on the synergistic effect of three core technical indicators:

  1. RSI Bands: The strategy employs a modified version of RSI Bands, calculating upper, lower, and middle bands based on RSI overbought (70) and oversold (30) levels. When price breaks below the lower band, it generates a long signal; when it breaks above the upper band, it generates a short signal. This mechanism utilizes the market’s mean reversion characteristics.

  2. WaveTrend (WT) Indicator: Using LazyBear’s WT1 indicator with default channel length of 11, average length of 12, overbought level of +60, and oversold level of -60. This indicator is a momentum oscillator used to confirm whether the market is in overbought or oversold conditions.

  3. Stochastic RSI: Using only the K line, with K length of 5, RSI length of 14, and Stoch length of 10. This indicator further confirms market overbought/oversold conditions, increasing signal reliability.

The signal generation logic is as follows: - Long signal: Price breaks below RSI lower band AND WT indicator is below oversold level (-60) AND Stochastic RSI K value is below oversold level (0+tolerance) - Short signal: Price breaks above RSI upper band AND WT indicator is above overbought level (+60) AND Stochastic RSI K value is above overbought level (100-tolerance)

The strategy offers two trigger modes: “Cross(close)” uses closing price crosses of RSI Bands, while “Touch(wick)” allows wick touches to trigger signals. Additionally, the strategy includes a reverse exit mechanism that can close positions and open reverse positions when opposite signals appear, suitable for highly volatile market environments.

Strategy Advantages

A deep analysis of the strategy code reveals the following significant advantages:

  1. Multi-layered Filtering System: By combining three different technical indicators (RSI Bands, WaveTrend, and Stochastic RSI), the strategy forms a robust multi-layered filtering system that significantly reduces the risk of false breakouts and improves the quality and reliability of trading signals.

  2. Flexible Trading Mechanism: The strategy provides multiple customizable options, including whether to use reverse exits, enable take-profit/stop-loss, and trigger mode selection, allowing traders to adjust according to market conditions and personal risk preferences.

  3. Efficient Risk Management: Built-in percentage-based take-profit and stop-loss mechanisms enable precise control of the risk-reward ratio for each trade, protecting capital safety.

  4. Automated Alert System: Integrated Telegram alert functionality enables real-time notification of trading signals, facilitating timely tracking and execution of trades.

  5. Anti-spam Mechanism: The strategy implements prevention of duplicate alerts, ensuring that signals are sent only once within the same candlestick, avoiding information redundancy.

  6. High-frequency Trading Adaptability: Based on a 1-minute timeframe, the strategy is suitable for high-frequency trading environments, capable of capturing short-term price fluctuations for quick market entries and exits.

Strategy Risks

Despite its sophisticated design, the strategy still presents some potential risks:

  1. High-frequency Trading Risks: High-frequency trading based on a 1-minute timeframe generates numerous trading signals, potentially leading to overtrading and increased transaction costs. Solution: Consider adding additional time filters or only trading during specific market sessions.

  2. False Breakout Risks: Despite multiple filters, false breakouts may still occur in highly volatile markets, leading to trading losses. Solution: Adjust indicator parameters, add confirmation conditions, or incorporate trend judgments from longer timeframes.

  3. Parameter Sensitivity: Strategy performance highly depends on parameter settings, and different market environments may require different parameters. Solution: Conduct thorough historical backtesting to find optimal parameter combinations and periodically re-optimize parameters.

  4. Market Trend Adaptability: This mean reversion strategy performs well in ranging markets but may underperform in strong trending markets. Solution: Add trend filters to limit counter-trend trading during strong trends.

  5. System Risks: Reliance on the Telegram notification system means that system failures could result in missed trading opportunities. Solution: Implement backup notification channels or local alert mechanisms.

Strategy Optimization Directions

Based on code analysis, the strategy can be optimized in the following directions:

  1. Add Market State Assessment: Introduce adaptive mechanisms that dynamically adjust strategy parameters based on market volatility and trend strength. This would enable the strategy to maintain good performance across different market environments. Implementation could involve calculating ATR (Average True Range) or volatility indicators to assess market conditions.

  2. Multi-timeframe Analysis: Integrate market trend information from higher timeframes, trading only in the direction of the main trend, or using different parameter settings under different trend conditions. For example, add daily or 4-hour trend judgments, going long only in uptrends and short only in downtrends.

  3. Optimize Entry Timing: Improve entry precision by adding volume confirmation or price action pattern recognition. Consider waiting for more favorable entry points after signal generation rather than entering immediately.

  4. Improve Take-profit and Stop-loss Mechanisms: Implement dynamic take-profit and stop-loss, such as trailing stops or volatility-based stop placements, to adapt to different market environments. For example, base stop-loss distances on ATR or use trailing stops to protect profits.

  5. Incorporate Machine Learning Elements: Use machine learning algorithms to automatically identify optimal parameter combinations or predict signal effectiveness. Train models on historical data to assign probability weights to each trading signal.

  6. Risk Exposure Management: Implement dynamic position sizing based on account equity, reducing trade size after consecutive losses and increasing it after consecutive wins for more scientific money management.

Conclusion

The “Multi-Oscillator Momentum Filtered Mean Reversion Bitcoin Trading Strategy” is a meticulously designed short-term trading system that effectively identifies market overbought/oversold conditions and captures mean reversion trading opportunities through the collaborative effect of RSI Bands, WaveTrend, and Stochastic RSI. The strategy features multiple filtering, flexible trading mechanisms, efficient risk management, and automated alerts, making it suitable for short-term Bitcoin traders.

However, the strategy also faces challenges such as high-frequency trading risks, false breakout risks, and market adaptability issues. By implementing optimizations like market state assessment, multi-timeframe analysis, entry timing optimization, improved take-profit/stop-loss mechanisms, and dynamic position management, the strategy’s stability and profitability can be further enhanced.

For quantitative traders looking to engage in short-term Bitcoin trading, this strategy provides a solid framework that can be personalized and optimized according to individual trading styles and market perceptions to achieve stable profitability.

Strategy source code
/*backtest
start: 2024-08-15 00:00:00
end: 2025-08-13 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BNB_USDT"}]
*/

//@version=5
strategy("RS BTC 1", overlay=true, max_labels_count=500, initial_capital=100, commission_type=strategy.commission.percent, commission_value=0.003, default_qty_type=strategy.percent_of_equity, default_qty_value=100, calc_on_every_tick=true, process_orders_on_close=false, pyramiding=0)

// ==== Inputs
// RSI Bands
rsiLen   = input.int(14, "RSI Length")
obLevel  = input.int(70, "RSI Overbought")
osLevel  = input.int(30, "RSI Oversold")

// WT (LazyBear)
wtLen1   = input.int(11, "WT Channel Length")
wtLen2   = input.int(12, "WT Avg Length")
wtOB     = input.float( 60.0, "WT Overbought (+)")
wtOS     = input.float(-60.0, "WT Oversold (-)")

// Stoch RSI (sadece K filtresi)
kLen     = input.int(5,  "StochRSI K")
rsiLenSR = input.int(14, "StochRSI RSI Length")
stLen    = input.int(10, "Stoch Length")
rsiSrc   = input.source(close, "RSI Source")
stochOB  = input.float(100.0, "StochRSI OB (K ≥)", step=0.1)
stochOS  = input.float(0.0,   "StochRSI OS (K ≤)", step=0.1)
eps      = input.float(0.5,   "Tolerance around 0/100", step=0.1)

// Tetik modu
triggerMode = input.string("Cross(close)", "Trigger mode", options=["Cross(close)","Touch(wick)"])
showMid     = input.bool(true,  "Show RSI mid band")

// Çıkış seçenekleri
useReverseExit = input.bool(true,  "Exit & reverse on opposite band cross (swing)")
useTP          = input.bool(true,  "Enable Take Profit %")
useSL          = input.bool(true,  "Enable Stop Loss %")
tpPerc         = input.float(1.00, "TP %", step=0.01, minval=0.01)
slPerc         = input.float(1.00, "SL %", step=0.01, minval=0.01)

// ==== RSI Bands (LazyBear) – Mantık aynı, sadece ince çizgi
src = close
ep  = 2 * rsiLen - 1
auc = ta.ema(math.max(src - src[1], 0), ep)
adc = ta.ema(math.max(src[1] - src, 0), ep)
x1  = (rsiLen - 1) * (adc * obLevel / (100 - obLevel) - auc)
x2  = (rsiLen - 1) * (adc * osLevel / (100 - osLevel) - auc)
ub  = x1 >= 0 ? src + x1 : src + x1 * (100 - obLevel) / obLevel
lb  = x2 >= 0 ? src + x2 : src + x2 * (100 - osLevel) / osLevel
mid = (ub + lb) / 2.0

plot(ub,  "RSI Upper", color=color.yellow, linewidth=1)
plot(lb,  "RSI Lower", color=color.aqua,   linewidth=1)
plot(showMid ? mid : na, "RSI Mid", color=color.gray, linewidth=1)

// ==== WaveTrend (LazyBear WT1)
ap  = hlc3
esa = ta.ema(ap, wtLen1)
d   = ta.ema(math.abs(ap - esa), wtLen1)
ci  = (ap - esa) / (0.015 * d)
wt1 = ta.ema(ci, wtLen2)

// ==== Stoch RSI K (0..100)
rsiVal   = ta.rsi(rsiSrc, rsiLenSR)
stochRaw = ta.stoch(rsiVal, rsiVal, rsiVal, stLen)
stochK   = ta.sma(stochRaw, kLen)

// ==== Sinyaller
longCrossRaw  = triggerMode == "Cross(close)" ? ta.crossunder(close, lb) : ta.crossunder(low,  lb)
shortCrossRaw = triggerMode == "Cross(close)" ? ta.crossover( close, ub) : ta.crossover( high, ub)

stochLongOK  = stochK <= (stochOS + eps)
stochShortOK = stochK >= (stochOB - eps)
wtLongOK     = wt1 < wtOS
wtShortOK    = wt1 > wtOB

longSig_raw  = longCrossRaw  and wtLongOK  and stochLongOK
shortSig_raw = shortCrossRaw and wtShortOK and stochShortOK

longSig  = useReverseExit ? longSig_raw  : (longSig_raw  and strategy.position_size == 0)
shortSig = useReverseExit ? shortSig_raw : (shortSig_raw and strategy.position_size == 0)

// ==== İşlemler
if longSig
    if useReverseExit and strategy.position_size < 0
        strategy.close("S")
    if strategy.position_size <= 0
        strategy.entry("L", strategy.long)

if shortSig
    if useReverseExit and strategy.position_size > 0
        strategy.close("L")
    if strategy.position_size >= 0
        strategy.entry("S", strategy.short)

// ==== TP / SL
if strategy.position_size > 0 and (useTP or useSL)
    longEntryPrice = strategy.position_avg_price
    longTP  = useTP ? longEntryPrice * (1 + tpPerc/100.0) : na
    longSL  = useSL ? longEntryPrice * (1 - slPerc/100.0) : na
    strategy.exit(id="L-EXIT", from_entry="L", limit=longTP, stop=longSL)

if strategy.position_size < 0 and (useTP or useSL)
    shortEntryPrice = strategy.position_avg_price
    shortTP = useTP ? shortEntryPrice * (1 - tpPerc/100.0) : na
    shortSL = useSL ? shortEntryPrice * (1 + slPerc/100.0) : na
    strategy.exit(id="S-EXIT", from_entry="S", limit=shortTP, stop=shortSL)


// ==== ENTRY alert (tek bar / tek kez) ====
// TV Alert -> Condition: Any alert() function call
// Webhook  -> https://api.telegram.org/bot<YOUR_TOKEN>/sendMessage
// Message  -> BOŞ (alert() JSON yolluyor)

chatId   = input.string("-1002849453919", "Telegram chat_id (channel)")
lotTxt   = input.string("0.20", "Lot (text)")
tpPips   = input.int(10000,  "TP (pip)")   // SL yok

makeJson(_txt) => '{"chat_id":"' + chatId + '","text":"' + _txt + '"}'

// MT5 sembolü sabit
longTxt  = 'BUY BTCUSD# '  + lotTxt + ' TP=' + str.tostring(tpPips) + 'pip'
shortTxt = 'SELL BTCUSD# ' + lotTxt + ' TP=' + str.tostring(tpPips) + 'pip'

// Giriş oldu mu? (bar içinde)
enteredLong  = strategy.position_size >  0 and strategy.position_size[1] <= 0
enteredShort = strategy.position_size <  0 and strategy.position_size[1] >= 0

// --- anti-spam: aynı barda yalnızca 1 kere gönder ---
var int  lastEntryBar = na
var int  lastDir      = 0   // +1: long, -1: short

if enteredLong and (lastEntryBar != bar_index or lastDir != 1)
    alert(makeJson(longTxt), alert.freq_once_per_bar)   // tek gönderim
    lastEntryBar := bar_index
    lastDir      := 1

if enteredShort and (lastEntryBar != bar_index or lastDir != -1)
    alert(makeJson(shortTxt), alert.freq_once_per_bar)
    lastEntryBar := bar_index
    lastDir      := -1