
Chiến lược chuyển đổi RSI nhanh của Noro là một chiến lược giao dịch định lượng sử dụng chỉ số RSI để xác định cơ hội mua quá mức. Chiến lược này kết hợp hình thức K-line, lọc đồng nhất và phương pháp dừng để kiểm soát rủi ro.
Chiến lược này dựa trên một số thành phần quan trọng:
Chiến lược chuyển đổi RSI nhanh của Noro chủ yếu đánh giá các tín hiệu mua và bán sau:
RSI nhanh vượt qua tín hiệu bán tháo: tạo ra tín hiệu giao dịch khi RSI nhanh vượt qua giới hạn trên hoặc vượt qua giới hạn dưới.
Tín hiệu hình dạng đường K: kết hợp kích thước thực thể đường K, hướng đường dương, xu hướng, hỗ trợ tín hiệu RSI nhanh.
Tín hiệu lọc đường trung bình: kết hợp với hướng đường trung bình của SMA, tránh bị phá vỡ giả.
Tín hiệu dừng lỗ: Hạn chế lỗ khi RSI nhanh trở lại vượt qua giới hạn trên hoặc dưới của nó
Cụ thể, chiến lược này dựa trên phạm vi mua bán quá mức của RSI nhanh để đánh giá cơ hội giao dịch. Khi RSI nhanh vượt qua giới hạn dưới, nó được coi là tín hiệu bán quá mức; Khi RSI nhanh vượt qua giới hạn trên, nó được coi là tín hiệu mua quá mức.
Để tránh tiếng ồn, chiến lược này bao gồm các phán đoán phụ sau:
Vì vậy, chiến lược này kết hợp RSI nhanh, K-line, đường trung bình và dừng để đưa ra quyết định giao dịch.
Chiến lược này có một số ưu điểm:
Chiến lược này cũng có một số rủi ro:
Để giảm thiểu rủi ro, có thể tối ưu hóa các khía cạnh sau:
Chiến lược này có thể được tối ưu hóa theo các khía cạnh sau:
Việc tiếp tục cải thiện chiến lược này thông qua các phương pháp như chặn, quản lý rủi ro, tối ưu hóa tham số và học máy có thể làm tăng đáng kể tính ổn định của chiến lược.
Nhìn chung, chiến lược chuyển đổi RSI nhanh của Noro kết hợp các chỉ số RSI nhanh với các chỉ số kỹ thuật đường K hỗ trợ, để thực hiện một chiến lược giao dịch ngắn để đánh giá quá mua quá bán. Chiến lược này đáp ứng nhanh chóng và dễ dàng tối ưu hóa, đồng thời thêm mô-đun dừng lỗ để kiểm soát rủi ro.
/*backtest
start: 2023-12-14 00:00:00
end: 2023-12-18 00:00:00
period: 15m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//Noro
//2018
//@version=2
strategy(title = "Noro's Fast RSI Strategy v1.7", shorttitle = "Fast RSI str 1.7", overlay = true)
//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
usemar = input(false, defval = false, title = "Use Martingale")
capital = input(100, defval = 100, minval = 1, maxval = 10000, title = "Capital, %")
usersi = input(true, defval = true, title = "Use Fast RSI Strategy")
usemm = input(true, defval = true, title = "Use Min/Max Strategy")
usebc = input(true, defval = true, title = "Use BarColor Strategy")
usesma = input(false, defval = false, title = "Use SMA Filter")
smaperiod = input(20, defval = 20, minval = 2, maxval = 1000, title = "SMA Filter Period")
fast = input(7, defval = 7, minval = 2, maxval = 50, title = "Fast RSI Period")
limit = input(30, defval = 30, minval = 1, maxval = 100, title = "RSI limit")
rsisrc = input(close, defval = close, title = "RSI Price")
rsibars = input(1, defval = 1, minval = 1, maxval = 20, title = "RSI Bars")
mmbars = input(1, defval = 1, minval = 1, maxval = 5, title = "Min/Max Bars")
showsma = input(false, defval = false, title = "Show SMA Filter")
showarr = input(false, defval = false, title = "Show Arrows")
fromyear = input(2018, defval = 2018, minval = 1900, maxval = 2100, title = "From Year")
toyear = input(2100, defval = 2100, minval = 1900, maxval = 2100, title = "To Year")
frommonth = input(01, defval = 01, minval = 01, maxval = 12, title = "From Month")
tomonth = input(12, defval = 12, minval = 01, maxval = 12, title = "To Month")
fromday = input(01, defval = 01, minval = 01, maxval = 31, title = "From day")
today = input(31, defval = 31, minval = 01, maxval = 31, title = "To day")
//Fast RSI
fastup = rma(max(change(rsisrc), 0), fast)
fastdown = rma(-min(change(rsisrc), 0), fast)
fastrsi = fastdown == 0 ? 100 : fastup == 0 ? 0 : 100 - (100 / (1 + fastup / fastdown))
//Limits
bar = close > open ? 1 : close < open ? -1 : 0
uplimit = 100 - limit
dnlimit = limit
//RSI Bars
upsignal = fastrsi > uplimit ? 1 : 0
dnsignal = fastrsi < dnlimit ? 1 : 0
uprsi = sma(upsignal, rsibars) == 1
dnrsi = sma(dnsignal, rsibars) == 1
//Body
body = abs(close - open)
abody = sma(body, 10)
//MinMax Bars
min = min(close, open)
max = max(close, open)
minsignal = min < min[1] and bar == -1 and bar[1] == -1 ? 1 : 0
maxsignal = max > max[1] and bar == 1 and bar[1] == 1 ? 1 : 0
mins = sma(minsignal, mmbars) == 1
maxs = sma(maxsignal, mmbars) == 1
//SMA Filter
sma = sma(close, smaperiod)
colorsma = showsma ? blue : na
plot(sma, color = colorsma, linewidth = 3)
//Signals
up1 = bar == -1 and (strategy.position_size == 0 or close < strategy.position_avg_price) and dnrsi and body > abody / 5 and usersi
dn1 = bar == 1 and (strategy.position_size == 0 or close > strategy.position_avg_price) and uprsi and body > abody / 5 and usersi
up2 = mins and (close > sma or usesma == false) and fastrsi < 70 and usemm
dn2 = maxs and (close < sma or usesma == false) and fastrsi > 30 and usemm
up3 = sma(bar, 2) == -1 and usebc
dn3 = sma(bar, 2) == 1 and usebc
exit = (((strategy.position_size > 0 and fastrsi > dnlimit and bar == 1) or (strategy.position_size < 0 and fastrsi < uplimit and bar == -1)) and body > abody / 2)
//Arrows
col = exit ? black : up1 or dn1 ? blue : up2 or dn2 ? red : na
needup = up1 or up2
needdn = dn1 or dn2
needexitup = exit and strategy.position_size < 0
needexitdn = exit and strategy.position_size > 0
plotarrow(showarr and needup ? 1 : na, colorup = blue, colordown = blue, transp = 0)
plotarrow(showarr and needdn ? -1 : na, colorup = blue, colordown = blue, transp = 0)
plotarrow(showarr and needexitup ? 1 : na, colorup = black, colordown = black, transp = 0)
plotarrow(showarr and needexitdn ? -1 : na, colorup = black, colordown = black, transp = 0)
//Trading
profit = exit ? ((strategy.position_size > 0 and close > strategy.position_avg_price) or (strategy.position_size < 0 and close < strategy.position_avg_price)) ? 1 : -1 : profit[1]
mult = usemar ? exit ? profit == -1 ? mult[1] * 2 : 1 : mult[1] : 1
lot = strategy.position_size == 0 ? strategy.equity / close * capital / 100 * mult : lot[1]
if up1 or up2 or up3
if strategy.position_size < 0
strategy.close_all()
strategy.entry("Long", strategy.long, needlong == false ? 0 : lot)
if dn1 or dn2 or dn3
if strategy.position_size > 0
strategy.close_all()
strategy.entry("Short", strategy.short, needshort == false ? 0 : lot)
if time > timestamp(toyear, tomonth, today, 23, 59) or exit
strategy.close_all()