该策略是一个基于多重技术指标交叉的趋势跟踪系统,结合了EMA(指数移动平均线)、LSMA(最小二乘移动平均线)和RSI(相对强弱指标)三个指标,通过多重信号确认来过滤交易机会。策略采用了自适应的止盈止损机制,可以根据市场波动动态调整风险管理参数。
策略的核心逻辑包括以下几个方面: 1. 使用短周期(6)和长周期(20)的EMA来捕捉趋势的转折点 2. 采用LSMA(333)作为长期趋势确认指标 3. 将RSI(14)的50分界线作为市场强弱的判断标准 4. 同时满足以下条件时开多仓: - EMA6上穿EMA20 - 价格在LSMA333之上 - RSI大于50 5. 同时满足以下条件时开空仓: - EMA6下穿EMA20 - 价格在LSMA333之下 - RSI小于50
该策略通过多重技术指标的配合使用,构建了一个相对稳健的趋势跟踪系统。策略的核心优势在于信号确认的可靠性,但同时也需要注意在不同市场环境下的适应性问题。通过持续优化和改进,策略有望在实际交易中取得更好的表现。
/*backtest
start: 2024-02-19 00:00:00
end: 2025-02-17 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("EMA 6-20 + LSMA 333 + RSI 50 Filtreli Al-Sat Stratejisi", overlay=true)
// Parametreler
emaShortLength = input.int(6, title="Kısa EMA Uzunluğu", minval=1)
emaLongLength = input.int(20, title="Uzun EMA Uzunluğu", minval=1)
lsmaLength = input.int(333, title="LSMA Uzunluğu", minval=1)
rsiLength = input.int(14, title="RSI Uzunluğu", minval=1)
stopLossPerc = input.float(1.0, title="Stop Loss Yüzdesi", minval=0.1)
takeProfitPerc = input.float(2.0, title="Take Profit Yüzdesi", minval=0.1)
// EMA Hesaplamaları
emaShort = ta.ema(close, emaShortLength)
emaLong = ta.ema(close, emaLongLength)
// LSMA Hesaplaması
lsma = ta.linreg(close, lsmaLength, 0)
// RSI Hesaplaması
rsi = ta.rsi(close, rsiLength)
// EMA Kesişimleri
emaCrossUp = ta.crossover(emaShort, emaLong) // EMA 6, EMA 20'nin üzerine çıkarsa
emaCrossDown = ta.crossunder(emaShort, emaLong) // EMA 6, EMA 20'nin altına inerse
// LSMA Filtresi
lsmaFilterBuy = close > lsma // Fiyat LSMA 333'ün üzerinde mi?
lsmaFilterSell = close < lsma // Fiyat LSMA 333'ün altında mı?
// RSI Filtresi
rsiFilterBuy = rsi > 50 // RSI 50'nin üzerinde mi?
rsiFilterSell = rsi < 50 // RSI 50'nin altında mı?
// Alım ve Satım Koşulları
if (emaCrossUp and lsmaFilterBuy and rsiFilterBuy) // EMA 6, EMA 20'nin üzerine çıkarsa VE fiyat LSMA 333'ün üzerindeyse VE RSI 50'nin üzerindeyse
strategy.entry("Al", strategy.long)
strategy.exit("Take Profit/Stop Loss", "Al", stop=close * (1 - stopLossPerc / 100), limit=close * (1 + takeProfitPerc / 100))
if (emaCrossDown and lsmaFilterSell and rsiFilterSell) // EMA 6, EMA 20'nin altına inerse VE fiyat LSMA 333'ün altındaysa VE RSI 50'nin altındaysa
strategy.entry("Sat", strategy.short)
strategy.exit("Take Profit/Stop Loss", "Sat", stop=close * (1 + stopLossPerc / 100), limit=close * (1 - takeProfitPerc / 100))
// EMA, LSMA ve RSI Çizgileri
plot(emaShort, color=color.blue, title="EMA 6", linewidth=2)
plot(emaLong, color=color.red, title="EMA 20", linewidth=2)
plot(lsma, color=color.orange, title="LSMA 333", linewidth=2)
hline(50, "RSI 50 Seviyesi", color=color.gray)
// Kesişim İşaretleri
plotshape(series=emaCrossUp and lsmaFilterBuy and rsiFilterBuy, location=location.belowbar, color=color.green, style=shape.labelup, text="Al Sinyali")
plotshape(series=emaCrossDown and lsmaFilterSell and rsiFilterSell, location=location.abovebar, color=color.red, style=shape.labeldown, text="Sat Sinyali")