Ý tưởng cốt lõi của chiến lược này là kết hợp hai chỉ số kỹ thuật tương đối mạnh (RSI) và Binance để có thể lọc tín hiệu giao dịch kép, giảm thiểu tối đa sự can thiệp của tín hiệu giả và cải thiện chất lượng tín hiệu.
Khi chỉ số RSI hiển thị tín hiệu mua quá mức hoặc bán quá mức, một cơ hội giao dịch sẽ được tạo ra khi giá phá vỡ hoặc điều chỉnh lại đường dây của Bollinger. Nó tổng hợp lợi thế của hai chỉ số khác nhau, xem xét cả đặc điểm thống kê của biến động thị trường và quan tâm đến tình trạng đa dạng của người tham gia thị trường, tạo ra cơ sở phán đoán toàn diện.
Trong phần RSI, chúng tôi cùng quan tâm đến hai chỉ số RSI với hai chu kỳ khác nhau, một chu kỳ ngắn hơn được sử dụng để nắm bắt tín hiệu mua bán quá mức và một chu kỳ dài hơn được sử dụng để xác nhận xu hướng đảo ngược. Khi RSI chu kỳ ngắn cho thấy mua bán quá mức và RSI chu kỳ dài cho thấy đảo ngược, được coi là tạo ra cơ hội giao dịch.
Trong phần Brin, chúng tôi quan tâm đến việc giá có phá vỡ đường đi lên xuống hay không. Brin phá vỡ đường đi lên là điểm bán, Brin phá vỡ đường đi xuống là điểm mua.
Khi tín hiệu RSI và tín hiệu Binance xuất hiện cùng một lúc, chúng tôi cho rằng cơ hội giao dịch đã hình thành và đưa ra lệnh giao dịch.
Có thể tránh và kiểm soát rủi ro bằng cách tối ưu hóa tham số, thu hẹp vị trí phù hợp và can thiệp nhân tạo.
Chiến lược kép RSI và Bollinger Bands tận dụng tối đa lợi thế của hai chỉ số để tạo ra tín hiệu chất lượng cao, có thể đạt được lợi nhuận đầu tư ổn định với điều kiện tối ưu hóa tham số và quản lý rủi ro. Kết hợp nhiều tín hiệu và mô hình cũng là hướng đi có thể trong tương lai.
/*backtest
start: 2023-11-11 00:00:00
end: 2023-12-04 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Ezieh Str.v2", shorttitle="Ezieh Str.v2", overlay=true, pyramiding=10, currency=currency.USD, slippage=3, commission_type=strategy.commission.cash_per_order, commission_value=0.04, initial_capital=1000)
UseDateFilter = input(title="Enable Date Filter" ,type=input.bool ,defval=false ,group="Date & Time" ,tooltip="Turns on/off date filter")
StartDate = input(title="Start Date Filter" ,type=input.time ,defval=timestamp("1 Jan 2000 00:00 +0000") ,group="Date & Time" ,tooltip="Date & time to start excluding trades")
EndDate = input(title="End Date Filter" ,type=input.time ,defval=timestamp("1 Jan 2100 00:00 +0000") ,group="Date & Time" ,tooltip="Date & time to stop excluding trades")
UseTimeFilter = input(title="Enable Time Session Filter" ,type=input.bool ,defval=false ,group="Date & Time" ,tooltip="Turns on/off time session filter")
TradingSession = input(title="Trading Session" ,type=input.session ,defval="1000-2200:1234567" ,group="Date & Time" ,tooltip="No trades will be taken outside of this range")
In(t) => na(time(timeframe.period, t)) == false
TimeFilter = (UseTimeFilter and not In(TradingSession)) or not UseTimeFilter
DateFilter = time >= StartDate and time <= EndDate
DateTime = (UseDateFilter ? not DateFilter : true) and (UseTimeFilter ? In(TradingSession) : true)
///////////// RSI
L_RSI_Length = input(7 , title="L_Length")
L_RSI_OverSold = input(45 , title="L_OverSold")
S_RSI_Length = input(14 , title="S_Length")
S_RSI_OverBought = input(65 , title="S_OverBought")
price = close
Lvrsi = rsi(price, L_RSI_Length)
Svrsi = rsi(price, S_RSI_Length)
///////////// Bollinger Bands
BBlength = input(title="Bollinger Period Length", type=input.integer, defval=100, minval=2)
BBmult = 2.1 // input(2.0, minval=0.001, maxval=50,title="Bollinger Bands Standard Deviation")
BBbasis = sma(price, BBlength)
BBdev = BBmult * stdev(price, BBlength)
BBupper = BBbasis + BBdev
BBlower = BBbasis - BBdev
source = close
plot(BBbasis, color=color.aqua,title="Bollinger Bands SMA Basis Line")
p1 = plot(BBupper, color=color.silver,title="Bollinger Bands Upper Line")
p2 = plot(BBlower, color=color.silver,title="Bollinger Bands Lower Line")
fill(p1, p2)
///////////// Colors
switch1=input(true, title="Enable Bar Color?")
switch2=input(true, title="Enable Background Color?")
///////////// Condition
LongCondition = crossover(Lvrsi, L_RSI_OverSold) and crossover(close ,BBlower)
ShortCondition = crossunder(Svrsi, S_RSI_OverBought) and crossunder(close,BBupper)
Longexcon = crossunder(low, BBupper)
Shortexcon = crossover(low, BBlower)
qt = round(strategy.equity/price, 3)
///////////// RSI + Bollinger Bands Strategy
if (not na(Lvrsi))
if LongCondition and DateTime
strategy.entry("RSI_BB_L", strategy.long, qty=qt, comment="Long")
else
strategy.cancel(id="RSI_BB_L")
if Longexcon
strategy.close("RSI_BB_L", qty_percent = 100, comment = "L_exit")
if ShortCondition and DateTime
strategy.entry("RSI_BB_S", strategy.short, qty=qt, comment="Short")
else
strategy.cancel(id="RSI_BB_S")
if Shortexcon
strategy.close("RSI_BB_S", qty_percent = 100, comment = "S_exit")
//plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)