
A estratégia é um sistema de rastreamento de tendências baseado em vários indicadores tecnológicos cruzados, combinando os três indicadores EMA, LSMA e RSI para filtrar oportunidades de negociação por meio de confirmação de múltiplos sinais. A estratégia usa um mecanismo de stop-loss adaptável que pode ajustar os parâmetros de gerenciamento de risco de acordo com a dinâmica do mercado.
A lógica central da estratégia é a seguinte:
A estratégia, através da combinação do uso de múltiplos indicadores técnicos, constrói um sistema de acompanhamento de tendências relativamente robusto. A vantagem central da estratégia reside na confiabilidade da confirmação do sinal, mas também precisa prestar atenção à adaptabilidade em diferentes ambientes de mercado. Com otimização e melhoria contínua, a estratégia tem a possibilidade de obter um melhor desempenho em negociações reais.
/*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")