该策略是一个基于均线和波动率的自适应交易系统,通过结合指数移动平均线(EMA)和平均真实波幅(ATR)构建动态交易通道,在价格触及上下通道时进行交易。策略的核心思想是捕捉市场的自然波动,在横盘整理行情中表现出色。
策略使用三个关键技术指标: 1. 短期EMA(默认10周期):作为价格中枢,用于构建交易通道的基准线 2. 长期EMA(默认30周期):作为趋势过滤器,帮助判断市场状态 3. ATR(默认14周期):度量市场波动率,用于动态调整通道宽度
交易通道的计算方法如下: - 上轨 = EMA + ATR × 乘数(默认0.5) - 下轨 = EMA - ATR × 乘数(默认0.5)
系统在价格触及上轨时开始做空,触及下轨时开始做多,推荐使用2:1的风险收益比。
这是一个设计合理的均值回归交易系统,通过技术指标组合捕捉市场波动机会。策略的优势在于其自适应性和客观性,但在应用时需要注意趋势环境的影响和参数优化。通过建议的优化方向,可以进一步提升策略的稳定性和盈利能力。策略适合在波动剧烈但趋势不明显的市场环境中使用,建议在实盘交易前进行充分的回测和参数优化。
/*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])