Indicators: TrendLinearReg

 

TrendLinearReg:

How a trend changes? How to determine a flat? ... etc. This indicator will help to answer these questions.

Author: Watashi

 

Looking for flat zones, where trades are uncertain, is very important.

Simple but effective !!

Thank you

 

This indicator acts much the same as EMAAngleZero. But the EmaAnglezero gives a faster response

 

Thanks for sharing this interesting indicator. I will try to use it and see what am I able to develop with it. By the way, can somebody tell me where can I find info concerning the mentioned EmaAnglezero?

 

Thanks for sharing this indicator, here is the TrendLinearReg expert advisor.

 

how do you tell if its a flat zone?

 
Thank you for this indicator - I was going to write it on my own, but no need for that anymore :)

But one problem I encountered in the calculation: you start the loop with i = 0, but shouldn't the first value be multiplied by 1 instead? Otherwise you will always get zero as first value.
I change it to this:
   for(int i=0; i<barsToCount; i++)
   {
      sumy+=Close[i+shift];
      sumxy+=Close[i+shift]*(i+1);
      sumx+=(i+1);
      sumx2+=(i+1)*(i+1);      
   }
 

This is a very effect filter with setting of 21 for the 15 minute charts! I am using it based on changes in color with couple of other indicators. It is working better for me than the colored MACD which used to be one of my favorite filters.

Thank you very much!

Reason: