
This strategy is an adaptive trading system based on moving averages and volatility, constructing dynamic trading channels by combining Exponential Moving Average (EMA) and Average True Range (ATR). The core idea is to capture natural market volatility, performing excellently in sideways markets.
The strategy utilizes three key technical indicators: 1. Short-term EMA (default 10 periods): Serves as price center, used as baseline for trading channel 2. Long-term EMA (default 30 periods): Acts as trend filter, helping determine market conditions 3. ATR (default 14 periods): Measures market volatility, used for dynamic channel width adjustment
Trading channel calculation method: - Upper Band = EMA + ATR × Multiplier (default 0.5) - Lower Band = EMA - ATR × Multiplier (default 0.5)
The system initiates short positions when price touches the upper band and long positions at the lower band, with a recommended risk-reward ratio of 2:1.
This is a well-designed mean reversion trading system that captures market volatility opportunities through technical indicator combinations. The strategy’s strengths lie in its adaptability and objectivity, but attention must be paid to trend environment effects and parameter optimization during application. Through the suggested optimization directions, the strategy’s stability and profitability can be further enhanced. The strategy is suitable for markets with high volatility but unclear trends, and it is recommended to conduct thorough backtesting and parameter optimization before live trading.
/*backtest
start: 2022-02-11 00:00:00
end: 2025-02-08 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © rolguergf34585
//@version=5
strategy("Grupo ROG - Cash Bands", overlay=true)
PeriodoATR = input.int(defval=14,title="Período ATR")
PeriodoMedia = input.int(defval=10,title="Período Média Móvel")
PeriodoFiltro = input.int(defval=30,title="Período Média Filtro")
Mult = input.float(defval=0.5,title="Multiplicador",step=0.1)
Casas_Decimais = input.int(defval=5,title="Casas Decimais")
ema = ta.ema(close,PeriodoMedia)
filtro = ta.ema(close,PeriodoFiltro)
atr = ta.atr(PeriodoATR)
upper = math.round(ema+atr*Mult,Casas_Decimais)
basis = ema
lower = math.round(ema-atr*Mult,Casas_Decimais)
tendencia = lower>filtro?1:upper<filtro?-1:0
plot(upper,color=color.red)
plot(lower,color=color.green)
//plot(filtro,color=color.white)
barcolor(tendencia==1?color.green:tendencia==-1?color.red:color.white)
longCondition = true//tendencia==1 //and close < lower[1]
shortCondition = true//tendencia==-1 //and close > upper[1]
// if (strategy.position_size>0)
// strategy.exit("Long", limit=upper[0])
// if (strategy.position_size<0)
// strategy.exit("Short", limit=lower[0])
if (longCondition)
strategy.entry("Long", strategy.long, limit=lower[0])
if (shortCondition)
strategy.entry("Short", strategy.short, limit=upper[0])