OPEN-SOURCE SCRIPT

Rail Line Levels [s3]

Updated
Plots support/resistance lines based on a neutral signal (white portion) of the Rail Line (variable moving average) for a period of time designated by the user (defaults to 9 bars). Support/Resistance lines will be removed after a period of tests and can be determined by the user (defaults to 26). Support/Resistance is deemed not as important or strong after several touches or tests. The trailer uses a combination of the calculation for the Rail Line (variable moving average) and an ATR to show the overall trend direction.

The indicator is centered around a Variable Moving Average. The Variable Moving Average (VMA) is a study that uses an Exponential Moving Average being able to automatically adjust its smoothing factor according to the market volatility.

In addition to the VMA, the indicator makes use of the ATR which measures market volatility by decomposing the entire range of an asset price for that period. The true range is taken as the greatest of the following: current high less the current low; the absolute value of the current high less the previous close; and the absolute value of the current low less the previous close.
Release Notes
ChangeLog1: changed default color theme
ChangeLog2: fixed spelling error and adjusted precision from 2 to 4 decimal places
ATRlevelsmovingavarageMoving AveragesSupport and ResistancesupportandresitanceTrend Analysisvariablemovingaveragevmavolitility

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 publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer