racer8

ATR Pivot Point Index [racer8]

racer8 已更新   
Description:

ATR Pivot Point Index (ATR_PPI) is based on the theory of mean reversion.
I was inspired to create this indicator after watching a particular YouTube video on the UKspreadbetting channel.
In this video, the trader being interviewed mentioned that he would exit when price is too far from the moving average.
In other words, he exits when he thinks price will revert back to the moving average (mean reversion).
I'm not sure what period moving average he used, so I set it to the standard 14 periods.

I wanted to quantify his strategy so that the user can consistently exit a trade at a fixed distance away from the moving average.
For this indicator, this distance is in ATR units.
This strategy of exiting is known as the mean reversion exit strategy.
Alternatively, if the user wishes to, this indicator can also be used as an entry indicator (Trend entry strategy).
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Parameters:
1. Sma Period - controls length of moving average (Affects histogram).
2. Atr Period - controls length of Atr, doesn't have much affect on indicator (Affects histogram).
3. Atr Pivot Point Level - controls horizontal line, it determines how far away in Atr units you want to exit/enter from the sma for every trade.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Interpreting signals:

(Trend entry strategy) When histogram is...
Green - enter long
Red - enter short
Purple - No signal

(Mean reversion exit strategy) When histogram is...
Green - exit long
Red - exit short
Purple - No signal
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Calculation:
Distance = Absolute value of (current close - moving average(14))
ATR_units = Distance / ATR(14) ...........Plot as histogram.
Add horizontal line set at (2)*ATR .......Plot line.
Is histogram > line?
Yes, histogram color is green/red.
No, histogram color is purple.

Note: For mean reversion exit strategy, I recommend HIGHER Atr Pivot Point Level values. Vice versa for trend entry strategy.
Enjoy :)
版本注释:
Minor fix of code.
版本注释:
...
Changed ATR Pivot Point Level to a default value of 1 instead of 2.
Changed consolidation color from purple to gray :D
版本注释:
>>>
- Changed consolidation color to indigo. Indigo is a rich color between blue and violet on the visible spectrum, it's a dark purplish blue.
- "ATR pivot point level" is now called "ATR level".
版本注释:
>>>
Added a simple moving average for the histogram.
版本注释:
>>>
Added option to show baseline (moving avg of histogram).
版本注释:
Added bar colors.
版本注释:
All values are now to 2 decimal places.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?