Autarch_Capital

HG Scalpius - ATR Up/Down Tick Highlight

HG Scalpius - ATR Up/Down Tick Highlight


This indicator highlights ATR(14) upticks (green) and downticks (red) and has the below application:
- If a new trend closing high (low) is made on a downtick in ATR, decreasing volatility mode turns on


If you come across or think of any other useful scripts for the HG Scalpius system please comment below!


Links to 2 previous HG Scalpius scripts:
- -

Happy trading!


Code:
study(title="Average True Range", shorttitle="ATR", overlay=false)

length = input(title="Length", defval=14, minval=1)
smoothing = input(title="Smoothing", defval="RMA", options=)



ma_function(source, length) =>
if smoothing == "RMA"
rma(source, length)
else
if smoothing == "SMA"
sma(source, length)
else
if smoothing == "EMA"
ema(source, length)
else
wma(source, length)

ATR = ma_function(tr(true), length)
c = ATR >= ATR ? color.lime : color.red

plot(ATR, title = "ATR", color=c, transp=0)


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.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?