
Cette stratégie est un système de négociation en ligne courte qui combine plusieurs indicateurs techniques pour générer des signaux de négociation principalement basés sur le RSI (indicateur de la force relative), l’EMA (moyenne mobile indicielle) et l’ATR (moyenne réelle de l’amplitude). La stratégie utilise la combinaison de plusieurs indicateurs, prenant en compte les tendances des prix et la volatilité du marché, tout en ajoutant sélectivement des filtres de transaction, pour construire un système de décision de négociation relativement complet.
La stratégie utilise un triple mécanisme de filtrage pour assurer la fiabilité des signaux de trading:
Les conditions spécifiques de déclenchement du signal polyvalent sont les suivantes:
Il s’agit d’un système de négociation multi-indicateurs conçu de manière rationnelle, qui améliore la fiabilité des transactions grâce à un mécanisme de confirmation multiple. Le principal avantage de la stratégie réside dans la combinaison d’une analyse de la tendance et de la volatilité, tout en tenant compte des multiples dimensions du marché. Bien qu’il existe une certaine marge d’optimisation, c’est une stratégie de négociation qui mérite d’être améliorée et mise en pratique.
/*backtest
start: 2024-12-12 00:00:00
end: 2024-12-19 00:00:00
period: 3m
basePeriod: 3m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Scalp Master BTCUSDT Strategy", overlay=true, max_labels_count=500, initial_capital=10000, commission_type=strategy.commission.percent, commission_value=0.1)
//=== Kullanıcı Parametreleri ===
rsi_length = input.int(14, "RSI Length")
rsi_lower_band = input.float(45, "RSI Lower Band")
rsi_upper_band = input.float(55, "RSI Upper Band")
ema_fast_length = input.int(5, "Fast EMA")
ema_slow_length = input.int(21, "Slow EMA")
atr_period = input.int(14, "ATR Period")
atr_mult = input.float(0.8, "ATR Multiplier")
volume_filter = input.bool(false, "Enable Volume Filter")
volume_period = input.int(20, "Volume SMA Period")
volume_mult = input.float(1.0, "Volume Threshold Multiplier")
//=== Hesaplamalar ===
// RSI Hesabı
rsi_val = ta.rsi(close, rsi_length)
// ATR Tabanlı Volatilite Kontrolü
atr_val = ta.atr(atr_period)
volatility_ok = atr_val > (ta.sma(atr_val, atr_period) * atr_mult)
// EMA Trend
ema_fast_val = ta.ema(close, ema_fast_length)
ema_slow_val = ta.ema(close, ema_slow_length)
trend_up = ema_fast_val > ema_slow_val
trend_down = ema_fast_val < ema_slow_val
// Hacim Filtresi
volume_sma = ta.sma(volume, volume_period)
high_volume = volume > (volume_sma * volume_mult)
// Sinyal Koşulları (Aynı Alarm Koşulları)
long_signal = trend_up and rsi_val < rsi_lower_band and volatility_ok and (volume_filter ? high_volume : true)
short_signal = trend_down and rsi_val > rsi_upper_band and volatility_ok and (volume_filter ? high_volume : true)
//=== Strateji Mantığı ===
// Basit bir yaklaşım:
// - Long sinyali gelince önce Short pozisyonu kapat, sonra Long pozisyona gir.
// - Short sinyali gelince önce Long pozisyonu kapat, sonra Short pozisyona gir.
if (long_signal)
strategy.close("Short") // Eğer varsa Short pozisyonu kapat
strategy.entry("Long", strategy.long)
if (short_signal)
strategy.close("Long") // Eğer varsa Long pozisyonu kapat
strategy.entry("Short", strategy.short)
// EMA Çizimleri
plot(ema_fast_val, title="Fast EMA (5)", color=color.new(color.orange, 0), linewidth=2)
plot(ema_slow_val, title="Slow EMA (21)", color=color.new(color.blue, 0), linewidth=2)
// Sinyal İşaretleri
plotshape(long_signal, title="BUY Signal", location=location.belowbar,
color=color.new(color.green, 0), style=shape.labelup, text="BUY")
plotshape(short_signal, title="SELL Signal", location=location.abovebar,
color=color.new(color.red, 0), style=shape.labeldown, text="SELL")
// Arka plan renklendirmesi
bgcolor(long_signal ? color.new(color.green, 85) : short_signal ? color.new(color.red, 85) : na)
// Alarm Koşulları (İndikatör ile aynı koşullar)
alertcondition(long_signal, title="Buy Alert", message="BTCUSDT Scalp Master: Buy Signal Triggered")
alertcondition(short_signal, title="Sell Alert", message="BTCUSDT Scalp Master: Sell Alert Triggered")