OPEN-SOURCE SCRIPT
200 EMA with ATR Bands

//version=6
indicator("200 EMA with ATR Bands", overlay=true)
// === Inputs ===
emaLength = input.int(200, "EMA Length", minval=1)
atrLength = input.int(14, "ATR Length", minval=1)
atrMult = input.float(1.5, "ATR Multiplier", step=0.1, minval=0.1)
emaColor = input.color(color.yellow, "EMA Color")
bandColor = input.color(color.new(color.teal, 80), "Band Fill Color")
// === Calculations ===
ema200 = ta.ema(close, emaLength)
atrVal = ta.atr(atrLength)
// Bands based on ATR
upperBand = ema200 + atrVal * atrMult
lowerBand = ema200 - atrVal * atrMult
// === Plot ===
plot(ema200, title="200 EMA", color=emaColor, linewidth=2)
pUpper = plot(upperBand, title="Upper ATR Band", color=color.new(color.teal, 0))
pLower = plot(lowerBand, title="Lower ATR Band", color=color.new(color.teal, 0))
// Fill the band region
fill(pUpper, pLower, color=bandColor, title="ATR Band Fill")
indicator("200 EMA with ATR Bands", overlay=true)
// === Inputs ===
emaLength = input.int(200, "EMA Length", minval=1)
atrLength = input.int(14, "ATR Length", minval=1)
atrMult = input.float(1.5, "ATR Multiplier", step=0.1, minval=0.1)
emaColor = input.color(color.yellow, "EMA Color")
bandColor = input.color(color.new(color.teal, 80), "Band Fill Color")
// === Calculations ===
ema200 = ta.ema(close, emaLength)
atrVal = ta.atr(atrLength)
// Bands based on ATR
upperBand = ema200 + atrVal * atrMult
lowerBand = ema200 - atrVal * atrMult
// === Plot ===
plot(ema200, title="200 EMA", color=emaColor, linewidth=2)
pUpper = plot(upperBand, title="Upper ATR Band", color=color.new(color.teal, 0))
pLower = plot(lowerBand, title="Lower ATR Band", color=color.new(color.teal, 0))
// Fill the band region
fill(pUpper, pLower, color=bandColor, title="ATR Band Fill")
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน