该策略基于EMA交叉、RSI和MACD三个技术指标,构建了一个双重趋势确认的交易策略。策略通过EMA交叉判断趋势方向,并使用RSI和MACD作为过滤条件,在趋势确认后发出交易信号。该策略适用于追踪趋势行情,同时避免在震荡市场中过早入场。
该策略通过EMA交叉、RSI和MACD三个指标的结合,构建了一个双重趋势确认的交易策略。策略逻辑清晰,信号直观,适用于追踪趋势行情。但在实际应用中,需要注意参数优化、震荡市风险和趋势转折点的判断。通过加入趋势过滤、优化入场时机、设置风险管理等措施,可以进一步提高策略的稳定性和盈利能力。
/*backtest
start: 2023-06-01 00:00:00
end: 2024-06-06 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("15 Dakikalık Göstergelerle Strateji", shorttitle="15m Strat", overlay=true)
// Parametreler
short_ma_length = input.int(9, title="Kısa EMA")
long_ma_length = input.int(21, title="Uzun EMA")
rsi_length = input.int(14, title="RSI Periyodu")
rsi_overbought = input.int(70, title="RSI Aşırı Alım")
rsi_oversold = input.int(30, title="RSI Aşırı Satım")
// EMA Hesaplamaları
short_ema = ta.ema(close, short_ma_length)
long_ema = ta.ema(close, long_ma_length)
// RSI Hesaplaması
rsi = ta.rsi(close, rsi_length)
// MACD Hesaplaması
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
// Göstergeleri Grafiğe Çizme
plot(short_ema, title="Kısa EMA", color=color.blue)
plot(long_ema, title="Uzun EMA", color=color.red)
hline(rsi_overbought, "Aşırı Alım", color=color.red)
hline(rsi_oversold, "Aşırı Satım", color=color.green)
plot(rsi, title="RSI", color=color.purple)
// İşlem Koşulları
longCondition = ta.crossover(short_ema, long_ema) and rsi < rsi_overbought and macdLine > signalLine
if (longCondition)
strategy.entry("Long", strategy.long)
shortCondition = ta.crossunder(short_ema, long_ema) and rsi > rsi_oversold and macdLine < signalLine
if (shortCondition)
strategy.entry("Short", strategy.short)
// Grafik Arkaplanı İşlem Koşullarına Göre Değiştirme
bgcolor(longCondition ? color.new(color.green, 90) : na, title="Long Signal Background")
bgcolor(shortCondition ? color.new(color.red, 90) : na, title="Short Signal Background")