Request: ATR% Multiple From 50-MA [TradingView]
This is an indicator I found while looking for novel approaches to mean reversion.
From the TradingView description:
How can one measure stock price extension?
In my view, decision-making in the trading business should rely on quantifiable data. A method I personally employ for scaling out and taking partial profits involves setting a threshold based on the multiple of Average True Range (ATR%) from the 50-day Simple Moving Average (SMA). For instance, I find it beneficial to start taking profits when positions exceed 7-10 times the ATR% from the 50-SMA. This practice helps prevent second-guessing or becoming emotionally attached to any particular position.
A relevant example illustrating this concept is the case of PLTR, SOFI, TSLA, VRT, NVDA which experienced a stall and subsequent decline after exceeding 10 times the ATR% from its 50-day moving average.
While there is no foolproof profit-taking mechanism that guarantees selling at the absolute market peak, employing this strategy can be a valuable tool for scaling out profits during extended periods to minimize potential losses.
The code is protected, but the formula is provided in the description:
A = ATR% = $ ATR / $ Last Done Price
B = % Gain From 50-MA
B / A = ATR% multiple from 50-MA
I should note one person suggests there would be a better way to do the calculations:
Calculating the ATR% multiple as shown B/A is questionable in the mathematical sense. The ratio B/A exaggerates upside extensions and compresses downside extensions. Please, check:
The proper mathematical way to do the calculation is using distance in dollars, ATR in dollars and then calculating the ratio of both quantities. It is also much simpler to calculate, and more easy to understand.
- First, calculate the distance from the current closing price to the MA of interest (for instance, SMA50).
- Second, calculate the ATR14 (or similar, it may be other length).
- Third, this is key, divide the distance (in dollars) by the ATR14 (in dollars). This is called the "distance of the price to the SMA measured in ATR14 units".
I'm interested in porting this indicator to MT4 for a few reasons.
I want to see how this indicator will behave on timeframes lower than the daily charts. I also want to see how it will behave with other instruments such as forex, futures, and commodities.
Additionally, this indicator is used to show when an asset is heavily over-bought (tops), but I wonder if it can be used in the opposite direction to show when an asset is heavily over-sold (bottoms).
More information can be found in
this Substack article written by the author of the indicator, at point #2.
I believe there's
an alternate version of this indicator (also a protected script) that plots the extremes in a separate window instead of on the chart, and in an oscillator fashion.
Thanks for all your help in advance!