
Chiến lược giao dịch RSI kép là một chiến lược giao dịch định lượng dựa trên chỉ số tương đối mạnh (RSI). Chiến lược này sử dụng cả RSI nhanh và RSI chậm như một tín hiệu giao dịch, thực hiện xác nhận kép, nhằm nâng cao chất lượng tín hiệu và lọc các tín hiệu giả.
Chiến lược này sử dụng hai chu kỳ RSI khác nhau làm chỉ số giao dịch chính. Chu kỳ RSI nhanh là 5 ngày, được sử dụng để nắm bắt tình trạng quá mua và quá bán trong thời gian ngắn; chu kỳ RSI chậm là 14 ngày, được sử dụng để đánh giá xu hướng trung hạn và kháng cự hỗ trợ quan trọng.
Các quy tắc giao dịch cụ thể là:
Chiến lược này tạo ra một tín hiệu giao dịch chất lượng cao bằng cách sử dụng kết hợp RSI nhanh và chậm, để thực hiện sự bù đắp giữa các chu kỳ khác nhau, có thể xác định hiệu quả các trường hợp quá mua và quá bán, đồng thời xác nhận xu hướng trung và dài hạn. Cơ chế lọc RSI kép cũng có thể làm giảm tiếng ồn giao dịch do phá vỡ giả.
Lợi thế lớn nhất của chiến lược RSI kép là có thể lọc hiệu quả các tín hiệu giả, cải thiện chất lượng tín hiệu, do đó giảm giao dịch không cần thiết, giảm tần suất giao dịch. Các lợi thế cụ thể như sau:
Chiến lược RSI hai lớp cũng có một số rủi ro, chủ yếu xuất phát từ các khía cạnh sau:
Những rủi ro này có thể được giảm bớt bằng cách:
Chiến lược RSI hai tầng có thể được tối ưu hóa hơn nữa, các hướng chính bao gồm:
Những tối ưu hóa trên có thể tiếp tục nâng cao lợi nhuận, tính ổn định và khả năng thích ứng của chiến lược.
Chiến lược RSI kép là một chiến lược giao dịch định lượng rất thực tế. Nó kết hợp các cơ chế như theo dõi xu hướng, nhận diện mua bán và lọc hai lần, tạo thành một hệ thống giao dịch tương đối hoàn chỉnh. Chiến lược này hoạt động xuất sắc trong việc kiểm soát rủi ro, giảm tần suất giao dịch và phù hợp để nắm giữ trong trung và dài hạn.
/*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)