Log in

sss_ai with r-squared confirmation

sss_ai with r-squared confirmation

This is a mod of spinal implant that I was recluctant to post. Not because it is a money machine but because I did not find any impro vement.

However the logic may be interesting and may be used into another EA model. So that is why I will post it.

 
 double rsquared=iCustom(NULL,TimeFrame,"r-squared",RSQPeriod,0,1);
 double iVAR_1=iCustom(NULL,TimeFrame,"iVAR",5,1000,0,1);
 double iVAR_2=iCustom(NULL,TimeFrame,"iVAR",5,1000,0,2);
 
 if(iVAR_2<a3  && iVAR_1<a4 && rsquared>rsquared_CriticalValue)

The logic is that not only here we want that in two consecutive bars we have an iVAR reading below a certain value a3 and a4 (those are the values the standard is 0.5) but we want that in the same time that we have a r-squared reading above r-squared level. I call this parameter rsquared_CriticalValue.

The r-squared shows the correlation with its linear regression line

So for r-squared we have two parameters:

rsquared_CriticalValue:


RSQPeriod:

There is a table that allow you to have in mind the relation:

 
To determine if the trend is statistically significant for a given x-period linear regression line, 
plot the r-squared indicator and refer to the following table.  This table shows the values of 
r-squared required for a 95% confidence level at various time periods.  If the r-squared value 
is less than the critical values shown, you should assume that prices show no statistically 
significant trend.

Number ofPeriods r-squaredCritical Value(95%confidence)

      5                 0.77
      10                0.40
      14                0.27
      20                0.20
      25                0.16
      30                0.13
      50                0.08
      60                0.06
      120               0.03

Installation note:


You need to install the r-squared indicator that is included in the rar file. You need also the iVAR and pfe indicator (those two are not inlued here refer to the original spinal implant).

Comments

  • jaguar1637 4675 days ago

    You idea, john is really interesting and intriguing?

    I notice you took those values :

    extern int RSQPeriod=10;
    extern double rsquared_CriticalValue=0.40;

    So, the calculation is made upon 10 bars.

    may be the RSQPeriod could be given by  the Cycle Period ? something like Cycle Period divided by 4 ? what do you think about ?

  • JohnLast 4675 days ago

    I am not sure about it. In fact I do not know.