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")

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน