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!











Script open-source

Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzarlo gratuitamente, ma il riutilizzo del codice è subordinato al rispetto del Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Vuoi usare questo script sui tuoi grafici?