
Đây là một chiến lược giao dịch đa chỉ số kết hợp Supertrend, chỉ số trung bình di chuyển ((EMA) và chỉ số tương đối mạnh ((RSI)). Chiến lược này sử dụng các tín hiệu chéo và mức độ mua bán quá mức của ba chỉ số kỹ thuật để xác định xu hướng, động lực và điểm đảo ngược tiềm năng của thị trường, để tìm kiếm cơ hội giao dịch lý tưởng trong thị trường. Chiến lược này tận dụng tối đa lợi thế của nhiều chỉ số để tăng độ chính xác và độ tin cậy của giao dịch thông qua phân tích thị trường theo các chiều khác nhau.
Lý luận cốt lõi của chiến lược dựa trên sự kết hợp của ba chỉ số kỹ thuật chính:
Các tín hiệu mua phải đáp ứng các điều kiện sau:
Các tín hiệu bán hàng phải đáp ứng các điều kiện sau:
Đây là một chiến lược giao dịch định lượng đa chỉ số có cấu trúc, logic rõ ràng, xây dựng một hệ thống giao dịch tương đối toàn diện bằng cách kết hợp theo dõi xu hướng, phân tích động lực và chỉ số mua bán quá mức. Ưu điểm của chiến lược là xác minh chéo đa chỉ số làm tăng độ tin cậy tín hiệu, đồng thời có cơ chế kiểm soát rủi ro rõ ràng. Mặc dù có một số rủi ro vốn có, nhưng bằng cách tối ưu hóa và hoàn thiện liên tục, chiến lược có thể duy trì hiệu suất ổn định trong các môi trường thị trường khác nhau.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-09 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © satyakipaul3744
//@version=6
//@version=6
strategy("Supertrend + EMA Crossover + RSI Strategy", overlay=true)
// --- Input Parameters ---
supertrend_length = input.int(10, title="Supertrend Length", minval=1)
supertrend_multiplier = input.float(3.0, title="Supertrend Multiplier", step=0.1)
short_ema_length = input.int(9, title="Short EMA Length")
long_ema_length = input.int(21, title="Long EMA Length")
rsi_length = input.int(14, title="RSI Length")
rsi_overbought = input.int(70, title="RSI Overbought Level")
rsi_oversold = input.int(30, title="RSI Oversold Level")
// --- Indicator Calculations ---
// Supertrend calculation
[supertrend, direction] = ta.supertrend(supertrend_multiplier, supertrend_length)
// EMA calculations
short_ema = ta.ema(close, short_ema_length)
long_ema = ta.ema(close, long_ema_length)
// RSI calculation
rsi = ta.rsi(close, rsi_length)
// --- Buy/Sell Conditions ---
// Buy condition: Supertrend bullish, EMA crossover, RSI not overbought
buy_condition = direction > 0 and ta.crossover(short_ema, long_ema) and rsi < rsi_overbought
// Sell condition: Supertrend bearish, EMA crossunder, RSI not oversold
sell_condition = direction < 0 and ta.crossunder(short_ema, long_ema) and rsi > rsi_oversold
// --- Plot Buy/Sell signals ---
plotshape(buy_condition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(sell_condition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// --- Strategy Orders for Backtesting ---
if buy_condition
strategy.entry("Buy", strategy.long)
if sell_condition
strategy.close("Buy")
// --- Plot Supertrend ---
plot(supertrend, color=direction > 0 ? color.green : color.red, linewidth=2, title="Supertrend")
// --- Plot EMAs ---
plot(short_ema, color=color.blue, title="Short EMA")
plot(long_ema, color=color.orange, title="Long EMA")
// --- Strategy Performance ---
// You can see the strategy performance in the "Strategy Tester" tab.