
Chiến lược này là một hệ thống giao dịch tổng hợp kết hợp nhiều chỉ báo, chủ yếu dựa trên phân tích toàn diện về Đường trung bình động hàm mũ (EMA), Siêu xu hướng, Dải Bollinger và Chỉ số sức mạnh tương đối (RSI). Logic cốt lõi của chiến lược này là xây dựng các tín hiệu giao dịch xung quanh EMA và Supertrend, đồng thời kết hợp Bollinger Bands và RSI để đưa ra phán đoán bổ trợ về biến động và động lực của thị trường. Hệ thống giao dịch sử dụng phân tích RSI đa giai đoạn, bao gồm hàng ngày, hàng tuần và hàng tháng, để cung cấp góc nhìn toàn diện hơn về thị trường cho các quyết định giao dịch.
Chiến lược này sử dụng sự kết hợp của nhiều chỉ báo kỹ thuật để nắm bắt xu hướng thị trường và cơ hội biến động:
Điều kiện kích hoạt tín hiệu giao dịch:
Chiến lược này xây dựng một hệ thống giao dịch tương đối hoàn chỉnh thông qua sự kết hợp hữu cơ của nhiều chỉ báo kỹ thuật. Sự kết hợp giữa EMA và Supertrend cung cấp các tín hiệu giao dịch chính, sàng lọc ADX đảm bảo các giao dịch diễn ra trong môi trường có xu hướng mạnh và phân tích phụ trợ của Bollinger Bands và RSI cung cấp thêm góc nhìn về thị trường. Ưu điểm chính của chiến lược này là độ tin cậy của tín hiệu và tính toàn vẹn của hệ thống, nhưng nó cũng phải đối mặt với những thách thức về độ trễ tín hiệu và tối ưu hóa tham số. Thông qua các hướng tối ưu hóa được đề xuất, chiến lược này dự kiến sẽ cải thiện lợi nhuận trong khi vẫn duy trì được tính ổn định.
/*backtest
start: 2019-12-23 08:00:00
end: 2025-01-04 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//made by Chinmay
//@version=6
strategy("CJ - Multi1", overlay=true)
// Input for RSI length
rsi_length = input.int(14, title="RSI Length")
// Calculate Daily RSI
daily_rsi = ta.rsi(close, rsi_length)
// Calculate Weekly RSI (using security function to get weekly data)
weekly_rsi = request.security(syminfo.tickerid, "W", ta.rsi(close, rsi_length))
// Calculate Monthly RSI (using security function to get weekly data)
monthly_rsi = request.security(syminfo.tickerid, "M", ta.rsi(close, rsi_length))
// Plot the RSIs
plot(daily_rsi, color=color.blue, title="Daily RSI", linewidth=2)
plot(weekly_rsi, color=color.red, title="Weekly RSI", linewidth=2)
plot(monthly_rsi, color=color.black, title="Monthly RSI", linewidth=2)
// Create horizontal lines at 30, 50, and 70 for RSI reference
hline(30, "Oversold", color=color.green)
hline(70, "Overbought", color=color.red)
hline(50, "Neutral", color=color.gray)
// Bollinger Bands Calculation
bb_length = 20
bb_mult = 2
bb_stddev = ta.stdev(close, bb_length)
bb_average = ta.sma(close, bb_length)
bb_upper = bb_average + bb_mult * bb_stddev
bb_lower = bb_average - bb_mult * bb_stddev
plot(bb_upper, color=color.new(#ffb13b, 0), linewidth=2)
plot(bb_average, color=color.new(#b43bff, 0), linewidth=2)
plot(bb_lower, color=color.new(#ffb13b, 0), linewidth=2)
// Inputs for EMA
ema_L1 = input.int(defval=13, title="EMA Length 1")
ema_L2 = input.int(defval=34, title="EMA Length 2")
ema_L3 = input.int(defval=100, title="EMA Length 3")
adx_level = input.int(defval=25, title="ADX Level")
// Inputs for Supertrend
atr_l = input.int(defval=10, title="ATR Length")
factor = input.float(defval=3.0, title="Supertrend Multiplier")
// Calculate EMA
ema1 = ta.ema(close, ema_L1)
ema2 = ta.ema(close, ema_L2)
ema3 = ta.ema(close, ema_L3)
// Calculate Supertrend
[supertrend, direction] = ta.supertrend(factor, atr_l)
// Calculate ADX and DI
[diplus, diminus, adx] = ta.dmi(14,14)
// Buy and Sell Conditions
buy = direction == -1 and ema1 > ema2 and close > ta.ema(close, 100) and adx > adx_level
short = direction == -1 and ema1 < ema2 and close < ta.ema(close, 100) and adx > adx_level
sell = ta.crossunder(close, supertrend)
cover = ta.crossover(close, supertrend)
// Strategy Logic
if buy
strategy.entry("Buy", strategy.long, comment="Long Entry")
if sell
strategy.close("Buy", comment="Sell Exit")
// Uncomment for Short Strategy
if short
strategy.entry("Short", strategy.short, comment="Short Entry")
if cover
strategy.close("Short", comment="Cover Exit")