Created
December 7, 2025 04:35
-
-
Save rajvermacas/7a3f8eea32e792f857df0d064e21e056 to your computer and use it in GitHub Desktop.
ADR Average Daily Range Pinescript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //@version=5 | |
| indicator("ADR Percentage", shorttitle="ADR%", overlay=false) | |
| len = input.int(20, title="Length", minval=1) | |
| tf = input.timeframe("1D", title="Timeframe") | |
| threshold = input.float(5.0, title="Threshold %", minval=0.0) | |
| adrPct = request.security(syminfo.tickerid, tf, 100 * (ta.sma(high / low, len) - 1)) | |
| plot(adrPct, title="ADR%", color=color.blue, linewidth=2) | |
| hline(threshold, title="Threshold", color=color.red, linestyle=hline.style_dashed) | |
| alertcondition(adrPct > threshold, title="ADR% Exceed", message="ADR% > threshold") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment