AliSignals

MA total distance on chart

NOTE:
The name I used for this indicator was created by me and I’m not sure if it has been used or created by any other trader/creator in the past or not!


Motivation to create:
One of the most important uses of “moving averages” is indicating the trend! There are different ways you can distinguish trend by using moving averages and one of the most popular type of it is comparing closing price to a MA. In this case if close is higher than the MA, trend is bullish and if close is lower than MA, it’s bearish. This method is really useful and I see great results in my long-term back-tests, especially SMA-100 in 1H chart filter so many fake signals in many different indicator-based strategies (Personal experience). There are so many problems with using indicators that sometimes have difficult solutions but one of them is fake breakout!


Looking at the top picture, you’ll get a breakout has happened but trend did not change!
A super bearish trend is obviously visible in the chart and we know a small break out might be a fake one, but what if we have an indicator make conditions of a trend change a little harder?


Introduction:
I was careful about how I used moving averages and I got that I will take not only the last candle close price into consideration, so in these kind of false breakouts I will not fall into trap of them, On the contrary, I find a good opportunity to enter the market opposite of the MA break! (In this case short trade). I calculate the total distance of last 40 candles and divide them to 40, to get the average distance, to each a mathematical score for power of our trend comparing to the MA!
Number are just default you can change them.
In the picture below you can see how well it filtered the false breakout.


As it is obvious, Timeframe, MA length, MA source and MA type are editable.

Since I do not tested this indicator enough (for me enough means more than 5000 trades and 10 years) I can’t suggest any settings as the best one.
The distance length, which means number of candles that their distance to MA is considered in our calculations, the distance source and also smoothing of the MATD is editable too.

And without editing it will look like something like this!











開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?