TrendNoTrend Indicator

Category: Indicators By: FULVIO09 Created: September 16, 2018, 12:06 PM
September 16, 2018, 12:06 PM
Indicators
6 Comments

The “Linear regression slope” indicates the direction and intensity of the current trend.
In the abstract hypothesis of total absence of trend the slope of the linear regression is equal to zero: the linear regression is a line parallel to the abscissa axis.
A statistical way of establishing that there is no trend, and so we are in a laterality phase of the market, consists in establishing that the slope of our linear regression is statistically equal to zero in the observation period.
To do this in statistics we use the “t-test”.
For all those who love statistical problems I attach the pdf files with the related explanations.
The statistical formula is translated into the following code.
In a normal distribution, 95% of the data is included in a confidence interval of “Average + – 1.96”.
A “t-distribution” with infinitely many degrees of freedom is a normal distribution.
With an approximation we can state that if    t <= 1.96  then our LinearRegressionSlope is equal to zero = there is no trend.

// period da ottimizzare
AA = period
t=(LinearRegressionSlope[AA](close)-0)*SQRT(AA-2)/(STE[AA](close)/STD[AA](Barindex))
if t<1.96 then
 beta=0
else
 beta=1
endif
return beta

 

Download
Filename: Confidence-Interval.pdf
Downloads: 226
Download
Filename: t-test.pdf
Downloads: 224
Download
Filename: TrendNoTrend.itf
Downloads: 447
FULVIO09 Senior
Currently debugging life, so my bio is on hold. Check back after the next commit for an update.
Author’s Profile

Comments

Logo Logo
Loading...