
La stratégie est un système de trading quantitatif basé sur l’indicateur RSI et la moyenne EMA, qui permet de négocier en combinant un signal de surachat et de survente d’un indice relativement faible (RSI) et une confirmation de tendance (EMA). La stratégie comprend un module de gestion des risques permettant de contrôler le risque en définissant un stop-loss (Stop-Loss) et un stop-take (Take-Profit). Selon les données de retesting, environ 70% des types de transactions ont été rentables lors d’un test sur plusieurs types de transactions sur une période de 15 minutes.
La logique fondamentale de la stratégie repose sur les éléments clés suivants :
Il s’agit d’une stratégie de trading quantifié structurée, logiquement claire, qui permet une génération de signaux de trading plus fiable grâce à une combinaison de RSI et d’EMA. Le mécanisme de gestion des risques et la flexibilité des paramètres de la stratégie la rendent pratique. Bien que certains risques potentiels existent, la stabilité et la rentabilité de la stratégie peuvent être encore améliorées par l’orientation de l’optimisation proposée.
/*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)