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. קרא עוד בתנאים וההגבלות.

רוצה להשתמש בסקריפ זה בגרף?