OPEN-SOURCE SCRIPT

Envelope

127
//version=5
indicator("FX 5分足 EMA+MACD+RSI 手法アラート", overlay=true)

// === EMA設定 ===
ema20 = ta.ema(close, 20)
ema50 = ta.ema(close, 50)
ema100 = ta.ema(close, 100)
plot(ema20, color=color.yellow, title="EMA 20")
plot(ema50, color=color.orange, title="EMA 50")
plot(ema100, color=color.red, title="EMA 100")

// === MACD設定 ===
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
macdBuy = ta.crossover(macdLine, signalLine)
macdSell = ta.crossunder(macdLine, signalLine)

// === RSI設定 ===
rsi = ta.rsi(close, 14)

// === ロング条件 ===
longCondition = ema20 > ema50 and ema50 > ema100 and close >= ema20 and macdBuy and rsi > 50 and rsi < 70
plotshape(longCondition, location=location.belowbar, color=color.green, style=shape.labelup, text="Buy", title="Buy Signal")

// === ショート条件 ===
shortCondition = ema20 < ema50 and ema50 < ema100 and close <= ema20 and macdSell and rsi < 50 and rsi > 30
plotshape(shortCondition, location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell", title="Sell Signal")

// === アラート設定 ===
alertcondition(longCondition, title="Buy Alert", message="Buy Signal: EMA + MACD + RSI conditions met")
alertcondition(shortCondition, title="Sell Alert", message="Sell Signal: EMA + MACD + RSI conditions met")

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.