
Chiến lược này là một hệ thống giao dịch định lượng dựa trên chỉ số RSI và đường trung bình EMA, giao dịch bằng cách kết hợp tín hiệu mua bán quá mức của chỉ số tương đối yếu ((RSI) với xác nhận xu hướng của đường trung bình di chuyển ((EMA)). Chiến lược này bao gồm mô-đun quản lý rủi ro để kiểm soát rủi ro bằng cách thiết lập dừng lỗ ((Stop-Loss) và dừng ((Take-Profit)). Theo dữ liệu kiểm tra lại, khoảng 70% các loại giao dịch đã đạt được lợi nhuận trên nhiều loại giao dịch được thử nghiệm trong khoảng thời gian 15 phút.
Logic cốt lõi của chiến lược này dựa trên các yếu tố chính sau:
Đây là một chiến lược giao dịch định lượng có cấu trúc, logic rõ ràng, tạo ra tín hiệu giao dịch đáng tin cậy hơn bằng cách sử dụng kết hợp RSI và EMA. Cơ chế quản lý rủi ro và tính linh hoạt của các tham số của chiến lược làm cho nó có tính thực tế tốt. Mặc dù có một số rủi ro tiềm ẩn, nhưng theo hướng tối ưu hóa được đề xuất, có thể nâng cao hơn nữa sự ổn định và lợi nhuận của chiến lược.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-27 08:00:00
period: 2d
basePeriod: 2d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("RSI BUY/SELL + EMA + SLTP by rcpislr", overlay=true)
// Kullanıcı Parametreleri
rsi_period = input(14, title="RSI Periyodu")
rsi_overbought = input(70, title="RSI Aşırı Alım Seviyesi")
rsi_oversold = input(30, title="RSI Aşırı Satım Seviyesi")
ema_period = input(400, title="EMA Periyodu")
use_ema = input(true, title="EMA Şartını Kullan")
sl_pct = input(1, title="Stop-Loss (%)") / 100
tp_pct = input(1, title="Take-Profit (%)") / 100
// Belirtilen Zaman Diliminde RSI ve EMA Hesaplamaları
rsi = ta.rsi(close, rsi_period)
ema = ta.ema(close, ema_period)
// Long ve Short Sinyalleri
long_signal = rsi[2] > rsi_overbought and rsi < rsi_overbought and (close > ema or not use_ema)
short_signal = rsi[2] < rsi_oversold and rsi > rsi_oversold and (close < ema or not use_ema)
// Alım/Satım İşlemleri
if long_signal
strategy.entry("Long", strategy.long)
if short_signal
strategy.entry("Short", strategy.short)
// Stop-Loss ve Take-Profit Uygulaması
if strategy.position_size > 0
long_stop_loss = close * (1 - sl_pct)
long_take_profit = close * (1 + tp_pct)
strategy.exit("Long Exit", from_entry="Long", stop=long_stop_loss, limit=long_take_profit)
if strategy.position_size < 0
short_stop_loss = close * (1 + sl_pct)
short_take_profit = close * (1 - tp_pct)
strategy.exit("Short Exit", from_entry="Short", stop=short_stop_loss, limit=short_take_profit)
// Sinyalleri Grafikte Göster
plotshape(series=long_signal, title="Long Sinyali", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=short_signal, title="Short Sinyali", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
plot(ema, title="EMA 400", color=color.orange)