逆向波动率突破策略是一种反转交易策略,它利用ATR、布林带、RSI和MACD等多个技术指标来识别市场的极端状态,并在市场出现反转信号时进行交易。与传统的突破策略不同,该策略在出现看涨信号时进行卖出,在出现看跌信号时进行买入,从而试图捕捉市场的反转机会。
该策略使用了以下指标来判断交易信号: 1. ATR(平均真实波动范围):用于衡量市场波动性。 2. 布林带:由中轨、上轨和下轨组成,反映价格的波动范围。 3. RSI(相对强弱指数):衡量价格走势的动量。 4. MACD(移动平均聚散):由MACD线和信号线组成,用于判断趋势。
策略的核心逻辑如下: - 当收盘价突破布林带上轨,RSI大于50,且MACD线在信号线之上时,产生卖出信号。 - 当收盘价跌破布林带下轨,RSI小于50,且MACD线在信号线之下时,产生买入信号。
逆向波动率突破策略是一种有趣的尝试,它利用多个技术指标捕捉市场的极端状态,并在市场出现反转信号时进行逆向交易。然而,该策略也存在一定的风险,需要谨慎应用。通过优化指标参数、引入风控措施和结合其他分析方法,可以进一步提高该策略的稳健性和盈利能力。
/*backtest
start: 2024-04-01 00:00:00
end: 2024-04-30 23:59:59
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Volatility Breakout Strategy (Reversed)", overlay=true)
// Indicator Inputs
atrLength = input(14, "ATR Length")
bbLength = input(20, "Bollinger Bands Length")
bbMultiplier = input(2, "Bollinger Bands Multiplier")
rsiLength = input(14, "RSI Length")
macdShortLength = input(12, "MACD Short Length")
macdLongLength = input(26, "MACD Long Length")
macdSignalSmoothing = input(9, "MACD Signal Smoothing")
// Calculate Indicators
atrValue = ta.atr(atrLength)
basis = ta.sma(close, bbLength)
deviation = bbMultiplier * ta.stdev(close, bbLength)
upperBand = basis + deviation
lowerBand = basis - deviation
rsiValue = ta.rsi(close, rsiLength)
[macdLine, signalLine, _] = ta.macd(close, macdShortLength, macdLongLength, macdSignalSmoothing)
// Strategy Conditions (Reversed)
longCondition = ta.crossover(close[1], upperBand[1]) and rsiValue > 50 and macdLine > signalLine
shortCondition = ta.crossunder(close[1], lowerBand[1]) and rsiValue < 50 and macdLine < signalLine
// Strategy Entry (Reversed)
if (longCondition)
strategy.entry("Sell", strategy.short) // Reversed: Buy signal triggers a sell
if (shortCondition)
strategy.entry("Buy", strategy.long) // Reversed: Sell signal triggers a buy
// Plotting
plot(basis, color=color.blue, title="Basis")
plot(upperBand, color=color.red, title="Upper Band")
plot(lowerBand, color=color.green, title="Lower Band")