OPEN-SOURCE SCRIPT

Bostian/Elder Accumulation Distribution

232
//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)

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.