
A estratégia de negociação de RSI dupla é uma estratégia de negociação quantitativa baseada em índices relativamente fortes (RSI). A estratégia usa simultaneamente RSI rápido e RSI lento como sinais de negociação, para realizar a dupla confirmação, com o objetivo de melhorar a qualidade do sinal e filtrar os falsos sinais.
A estratégia usa dois RSI de diferentes períodos como indicadores principais de negociação. O RSI rápido tem um período de 5 dias, para capturar o excesso de compra e venda em curto prazo; O RSI lento tem um período de 14 dias, para determinar a tendência de médio e longo prazo e a resistência de suporte crítico.
As regras específicas de negociação são:
A estratégia, através de uma combinação de RSI rápido e lento, permite a compensação entre os diferentes períodos, sendo capaz de identificar efetivamente situações de sobrecompra e sobrevenda, ao mesmo tempo em que confirma tendências de médio e longo prazo, resultando em um sinal de negociação de alta qualidade. O mecanismo de filtragem do RSI duplo também é capaz de reduzir o ruído de negociação causado por falsas rupturas.
A maior vantagem da estratégia de RSI dupla é a capacidade de filtrar efetivamente os falsos sinais, melhorar a qualidade do sinal, reduzindo assim as transações desnecessárias e reduzindo a frequência de negociação. As vantagens específicas são as seguintes:
A estratégia de RSI dupla também apresenta alguns riscos, principalmente a partir de:
Os riscos podem ser reduzidos por:
A estratégia do RSI de dois níveis tem espaço para uma maior otimização, e as principais direções incluem:
As melhorias acima podem melhorar ainda mais a rentabilidade, robustez e adaptabilidade das estratégias.
A estratégia de RSI dupla é, em geral, uma estratégia de negociação quantitativa muito prática. Combina mecanismos como rastreamento de tendências, identificação de sobrecompra e sobrevenda e filtragem dupla, formando um sistema de negociação relativamente completo. A estratégia tem um excelente desempenho no controle de risco, redução da frequência de negociação e outros aspectos e é adequada para ser mantida a médio e longo prazo.
/*backtest
start: 2023-12-30 00:00:00
end: 2024-01-29 00:00:00
period: 1h
basePeriod: 15m
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/
// © Ankit_Quant
//@version=4
// ********************************************************************************************************
// This was coded live during webinar on Backtesting in Tradingview
// That was held on 16-Jan-21
// Aim of this strategy is to code a Double Decker RSI Strategy - Rules of Strategy are given in Description
// *********************************************************************************************************
// Identifier of strategy or an indicator (study())
strategy(title="Strategy- Double Decker RSI",shorttitle='Strategy - Double Decker RSI',overlay=true)
// ********************
// INPUTS
// ********************
// RSI Lookback Periods
slowRSI=input(defval=14,title='Slow RSI Period',type=input.integer)
fastRSI=input(defval=5,title='Fast RSI Period',type=input.integer)
// Time Period Backtesting Input
start_year=input(defval=2000,title='Backtest Start Year',type=input.integer)
end_year=input(defval=2021,title='Backtest End Year',type=input.integer)
//Specific Years to Test Starategy
timeFilter=true
// Trade Conditions and signals
long = rsi(close,fastRSI)>70 and rsi(close,slowRSI)>50
short = rsi(close,fastRSI)<40 and rsi(close,slowRSI)<50
long_exit=rsi(close,fastRSI)<55
short_exit=rsi(close,fastRSI)>45
//positionSize - 1 Unit (also default setting)
positionSize=1
// Trade Firing - Entries and Exits
if(timeFilter)
if(long and strategy.position_size<=0)
strategy.entry(id='Long',long=strategy.long,qty=positionSize)
if(short and strategy.position_size>=0)
strategy.entry(id="Short",long=strategy.short,qty=positionSize)
if(long_exit and strategy.position_size>0)
strategy.close_all(comment='Ex')
if(short_exit and strategy.position_size<0)
strategy.close_all(comment='Ex')
// Plot on Charts the Buy Sell Labels
plotshape(strategy.position_size<1 and long,style=shape.labelup,location=location.belowbar,color=color.green,size=size.tiny,text='Long',textcolor=color.white)
plotshape(strategy.position_size>-1 and short,style=shape.labeldown,location=location.abovebar,color=color.red,size=size.tiny,text='Short',textcolor=color.white)
plotshape(strategy.position_size<0 and short_exit?1:0,style=shape.labelup,location=location.belowbar,color=color.maroon,size=size.tiny,text='ExShort',textcolor=color.white)
plotshape(strategy.position_size>0 and long_exit?1:0,style=shape.labeldown,location=location.abovebar,color=color.olive,size=size.tiny,text='ExLong',textcolor=color.white)