peacefulLizard50262

Slope Normalized (SN)

Introduction:

The Normalized Slope script is a technical indicator that aims to measure the strength and direction of a trend in a financial market. It does this by calculating the slope of the source data series, which can be any type of data (such as price, volume, or an oscillator) over a specified length of time. The slope is then normalized, meaning it is transformed to a scale between -1 and 1, with 0 representing a flat trend.

Methodology:

The Normalized Slope script uses an exponential smoothing function to smooth the source data series. The smoothing factor, or alpha, can be adjusted by the user through the input parameter "Pre Smoothing".

Next, the script calculates the slope of the smoothed data series by finding the average difference between the current value and the values of the previous "Length" periods. This slope is then normalized using a function that scales the data to a range of -1 to 1, with 0 representing a flat trend. The normalization function takes the minimum and maximum values of the slope, calculates the difference between them, and then scales the data to the range of -1 to 1.

The normalized slope is then smoothed again using another exponential smoothing function with a user-adjustable smoothing factor (the "Post Smoothing" input parameter). A center line representing a flat trend can also be plotted on the chart by enabling the "Center Line" input parameter. Additionally, the user can choose to display bounds at the -1 and 1 levels by enabling the "Bounds" input parameter.

Conclusion:

The Normalized Slope script provides traders with a visual representation of the strength and direction of a trend in a financial market. It can be used as a standalone indicator or in combination with other technical analysis tools to help traders make informed trading decisions.
Release Notes:
Added outlier detection lmfao.
Release Notes:
added hard clipping
Release Notes:
I added a switch to disable hard clipping.
Release Notes:
you can now fine tune the outlier level
Release Notes:
Major Update
Release Notes:
minor bug fix
Release Notes:
Major Update
Release Notes:
minor bug fix again?
Release Notes:
updated bounds minimum

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?