OPEN-SOURCE SCRIPT
Bostian/Elder Accumulation Distribution

//version=6
indicator(title="Bostian/Elder Accumulation Distribution", shorttitle="Bostian A/D", format=format.volume, overlay=false, timeframe="", timeframe_gaps=true)
// 1. Volumen-Überprüfung (Sicherheitsabfrage)
var cumVol = 0.
cumVol += nz(volume)
if barstate.islast and cumVol == 0
runtime.error("No volume is provided by the data vendor.")
// 2. Berechnung nach David Bostian: (Close - Open) / (High - Low) * Volumen
// Die Abfrage verhindert eine Division durch Null bei Doji-Kerzen (high == low)
ad_value = high == low ? 0 : ((close - open) / (high - low)) * volume
// 3. Fortlaufende Kumulierung der täglichen Werte
ad = ta.cum(ad_value)
// 4. Grafische Ausgabe
plot(ad, title = "Bostian A/D Line", color=#999915, linewidth=2)
indicator(title="Bostian/Elder Accumulation Distribution", shorttitle="Bostian A/D", format=format.volume, overlay=false, timeframe="", timeframe_gaps=true)
// 1. Volumen-Überprüfung (Sicherheitsabfrage)
var cumVol = 0.
cumVol += nz(volume)
if barstate.islast and cumVol == 0
runtime.error("No volume is provided by the data vendor.")
// 2. Berechnung nach David Bostian: (Close - Open) / (High - Low) * Volumen
// Die Abfrage verhindert eine Division durch Null bei Doji-Kerzen (high == low)
ad_value = high == low ? 0 : ((close - open) / (high - low)) * volume
// 3. Fortlaufende Kumulierung der täglichen Werte
ad = ta.cum(ad_value)
// 4. Grafische Ausgabe
plot(ad, title = "Bostian A/D Line", color=#999915, linewidth=2)
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน