Average Daily Range (ADR) with variable look back period

This script allows the user to change the look back period with a default of 7 periods. Fixed stops and/or profit targets can lead to risk mismanagement during high or low volatility conditions. For a particular setup, a profit target could be say 15% of the ADR and the stop at 10% of the ADR. ADR is sometimes preferred over ATR ( Average True Range ) as the former doesn't include gaps
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?