OPEN-SOURCE SCRIPT

Gold Trading Signal

101
//version=5
indicator("Gold Trading Signal", overlay=true)

// Input parameter
emaLength = input(200, title="EMA Length")

// Calculate EMA
ema200 = ta.ema(close, emaLength)

// Buy & Sell Conditions
buyCondition = ta.crossover(close, ema200)
sellCondition = ta.crossunder(close, ema200)

// Plot signals
plot(ema200, title="EMA 200", color=color.blue, linewidth=2)
plotshape(buyCondition, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY")
plotshape(sellCondition, location=location.abovebar, color=color.red, style=shape.labeldown, title="SELL")

// Alerts
alertcondition(buyCondition, title="Buy Signal", message="Gold Buy Signal")
alertcondition(sellCondition, title="Sell Signal", message="Gold Sell Signal")

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.