この戦略は,多周期指数移動平均 ((EMA),相対的に強い指数 ((RSI) と移動平均傾向散乱指数 ((MACD) に基づくトレンド追跡取引システムである.この戦略は,複数のEMAの並列形状によって市場のトレンドを識別し,RSIとMACDの動態確認を組み合わせて,入場タイミングを最適化するとともに,EMAに基づくストップ・ロス・アンド・テイク方法を使用してリスクと利益を管理する.
戦略は,5,14,34および55サイクルで形成される”EMA滝”の形状を使用して,トレンドの方向を判断する.上昇傾向では,EMA5>EMA14>EMA34>EMA55を要求し,下降傾向では,その逆である.MACD線がゼロ軸を横切って,RSIが50 (多頭) 以上または50 (空頭) 以下であるとき,取引シグナルを触発する.ストップロスは34サイクルEMAで設定され,利益はストップロスの3倍の目標である.
これは合理的に設計されたトレンド追跡戦略で,複数の技術指標を組み合わせることで,取引の信頼性を確保すると同時に,リスクを効果的に制御します.戦略は,波動的な市場で不良なパフォーマンスを発揮するかもしれませんが,推奨された最適化の方向によって,その適応性と安定性をさらに向上させることができます.
/*backtest
start: 2024-02-19 00:00:00
end: 2025-02-16 08:00:00
period: 4h
basePeriod: 4h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("EMA + MACD + RSI Strategy", overlay=true)
// Parametreler
length5 = 5
length14 = 14
length34 = 34
length55 = 55
rsiLength = 14
macdShort = 12
macdLong = 26
macdSignal = 9
// EMA Hesaplamaları
ema5 = ta.ema(close, length5)
ema14 = ta.ema(close, length14)
ema34 = ta.ema(close, length34)
ema55 = ta.ema(close, length55)
// RSI Hesaplaması
rsi = ta.rsi(close, rsiLength)
// MACD Hesaplaması
[macdLine, signalLine, _] = ta.macd(close, macdShort, macdLong, macdSignal)
macdZeroCross = ta.crossover(macdLine, 0) or ta.crossunder(macdLine, 0)
// Alış ve Satış Koşulları
longCondition = ema5 > ema14 and ema14 > ema34 and ema34 > ema55 and macdZeroCross and rsi > 50
shortCondition = ema5 < ema14 and ema14 < ema34 and ema34 < ema55 and macdZeroCross and rsi < 50
// Plotlar
plot(ema5, color=color.blue, linewidth=1)
plot(ema14, color=color.green, linewidth=1)
plot(ema34, color=color.red, linewidth=1)
plot(ema55, color=color.orange, linewidth=1)
plot(rsi, title="RSI", color=color.purple, linewidth=1, style=plot.style_line)
// Alış ve Satış Sinyalleri
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
// Stop-loss ve Take-profit hesaplamaları
stopLoss = ema34
takeProfit = stopLoss * 3
// Stop-loss ve Take-profit Stratejisi
strategy.exit("Exit Long", from_entry="Long", stop=stopLoss, limit=takeProfit)
strategy.exit("Exit Short", from_entry="Short", stop=stopLoss, limit=takeProfit)