The Volatility function measures the market volatility by plotting a
smoothed average of the True Range. It returns an average of the TrueRange
over a specific number of bars, giving higher weight to the TrueRange of
the most recent bar.
You can change long to short in the Input Settings
- For purpose educate only
- This script to change bars colors.
Based on the modified true range formula measuring the distance between high and low, high and previous close, and low and previous close.
When the price action breaks the true range average in either direction, a text saying long or short will appear on the chart.