如果你喺 TradingView 上搵唔到內建嘅 A-D Line 指標,可以用以下 Pine Script 自訂:
1. 打開 TradingView → Pine Editor → 貼上以下代碼 → Save → Add to Chart
//@version=5
indicator("Advance-Decline Line", shorttitle="A/D Line", overlay=false)
adv = input.symbol("NYSE:NYA", title="Advances Source", group="Data Sources")
dec = input.symbol("NYSE:NYA", title="Declines Source", group="Data Sources")
advances = request.security(adv, timeframe.period, close)
declines = request.security(dec, timeframe.period, close)
net = advances - declines
ad_line = ta.cum(net)
plot(ad_line, title="A/D Line", color=color.green, linewidth=2)
ad_ma = ta.sma(ad_line, 50)
plot(ad_ma, title="A/D Line MA50", color=color.orange, linewidth=1)
hline(0, "Zero", color.gray)