
이 전략은 여러 기술 지표들을 결합한 단선 거래 시스템으로, 주로 RSI (대비적으로 강한 지표), EMA (지수 이동 평균) 및 ATR (진짜 파도 평균) 에 기반한 거래 신호를 생성한다. 이 전략은 가격 추세를 고려하고 시장의 변동성을 고려하는 여러 지표들의 조합을 통해 거래 결정 시스템을 구축하기 위해 거래 결정 시스템을 비교적 완전하게 구성합니다.
이 전략은 트레이딩 신호의 신뢰성을 보장하기 위해 세 가지 필터링 메커니즘을 사용합니다.
다공지 신호의 구체적인 발사 조건은 다음과 같다:
이것은 합리적으로 설계된 다중 지표 거래 시스템이며, 여러 확인 메커니즘을 통해 거래의 신뢰성을 높인다. 전략의 핵심 장점은 시장의 여러 차원을 고려하면서 추세와 변동성 분석을 결합한다는 것이다. 약간의 최적화 공간이 있지만, 전체적으로 더 개선하고 실행할 가치가 있는 거래 전략이다.
/*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")