Built-in indicator ADR shows only NYSE data. This script allows you select the exchange to use.
study(title="Advance Decline Ratio (Custom)", shorttitle="ADR_Custom") src = input(close) exch = input(0, "Exchange to use: 0-Total, 1-NYSE, 2-AMEX, 3-OTC, 4-ETFS, 5-NASD, 6-TSX", minval=0, maxval=6) pr = "INDEX" suffix = exch == 1 ? "N" : exch == 2 ? "A" : exch == 3 ? "D" : exch == 4 ? "E" : exch == 5 ? "Q" : exch == 6 ? "S" : exch == 0 ? "T" : "" adv = security(tickerid(pr, "ADV" + suffix), period, src) dec = security(tickerid(pr, "DEC" + suffix), period, src) plot(adv / dec)