
Chiến lược này là một hệ thống giao dịch đảo ngược trong khoảng thời gian động dựa trên chỉ số RSI, để nắm bắt các điểm biến của thị trường bằng cách thiết lập các khoảng thời gian mua bán vượt trội có thể điều chỉnh được, kết hợp với tham số nhạy cảm kết hợp / phân tán. Chiến lược sử dụng số lượng hợp đồng cố định để giao dịch và hoạt động trong một khoảng thời gian đo lại cụ thể.
Chiến lược sử dụng chỉ số RSI 14 chu kỳ làm chỉ số cốt lõi, đặt 80 và 30 làm mức chuẩn cho việc mua bán quá mức. Bằng cách giới thiệu tham số nhạy cảm thu hẹp / phân tán (được đặt là 3.0) tăng khả năng điều chỉnh động trên cơ sở chiến lược RSI truyền thống.
Đây là một chiến lược đảo ngược khu vực động dựa trên chỉ số RSI, tạo ra một hệ thống giao dịch tương đối hoàn chỉnh thông qua các thiết lập tham số linh hoạt và các quy tắc giao dịch rõ ràng. Ưu điểm chính của chiến lược là khả năng điều chỉnh động và kiểm soát rủi ro rõ ràng, nhưng cũng cần chú ý đến rủi ro tiềm ẩn trong thị trường biến động và thị trường xu hướng.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-11 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("RSI Options Strategy", overlay=true)
// RSI settings
rsiLength = input(14, title="RSI Length")
rsiOverbought = input(80, title="Overbought Level")
rsiOversold = input(30, title="Oversold Level")
rsiSource = input(close, title="RSI Source")
rsi = ta.rsi(rsiSource, rsiLength)
// Convergence/Divergence Input
convergenceLevel = input(3.0, title="Convergence/Divergence Sensitivity")
// Order size (5 contracts)
contracts = 10
// Date Range for Backtesting
startDate = timestamp("2024-09-10 00:00")
endDate = timestamp("2024-11-09 23:59")
// Limit trades to the backtesting period
inDateRange = true
// RSI buy/sell conditions with convergence/divergence sensitivity
buySignalOverbought = ta.crossover(rsi, rsiOverbought - convergenceLevel)
sellSignalOversold = ta.crossunder(rsi, rsiOversold + convergenceLevel)
buySignalOversold = ta.crossunder(rsi, rsiOversold - convergenceLevel)
sellSignalOverbought = ta.crossover(rsi, rsiOverbought + convergenceLevel)
// Execute trades only within the specified date range
if (inDateRange)
// Buy when RSI crosses above 80 (overbought)
if (buySignalOverbought)
strategy.entry("Buy Overbought", strategy.long, qty=contracts)
// Sell when RSI crosses below 30 (oversold)
if (sellSignalOversold)
strategy.close("Buy Overbought")
// Buy when RSI crosses below 30 (oversold)
if (buySignalOversold)
strategy.entry("Buy Oversold", strategy.long, qty=contracts)
// Sell when RSI crosses above 80 (overbought)
if (sellSignalOverbought)
strategy.close("Buy Oversold")
// Plot the RSI for visualization
plot(rsi, color=color.blue, title="RSI")
hline(rsiOverbought, "Overbought", color=color.red)
hline(rsiOversold, "Oversold", color=color.green)