Discussion of article "Statistical Carry Trade Strategy" - page 2

 

Hi ruslan

thank you for article

 
I am not math expert ,but pretty sure that the whole calculations are wrong
 
double averagex = open1[0]-open1[100] / 100;

what I expect is the summation of all the open prices from 0 through 100, divided by 100
besides, the following formula
y = 2 * x + 1 

does not seem to be true.
Can anyone with more knowledge in math justify me?
 

There is an error in the message box :

         MessageBox(recomendation,"Not recommended", 1);

To be replaced with :

         MessageBox(recomendation + " ...Not recommended", 1);

So to get the message not recommanded


Post scriptum : it is not an error, the "not recommended" is the title of the box, but on an black screen, it is not seen.

The "return(0);"  should be all deleted


For this part

 if(b>0) 
     {
      Print("###", _Symbol+" = ",a," * "+secondpair+" + ",b);
        } else {
      Print("###   ",_Symbol+" = ",a," * "+secondpair+" - ",MathAbs(b));
     } 

here are the result I get :

2019.04.06 15:41:15.077    StatisticCarryTrading USDCHF,Daily: ###   USDCHF = -0.9075968272144176 * AUDUSD - 0.0001681237443192841


2019.04.06 15:41:20.802    StatisticCarryTrading USDCHF,Daily: recomendation  Average daily profit: 1.681237443192841 points

2019.04.06 15:41:19.539    StatisticCarryTrading USDCHF,Daily:  recomendation  Correlation coefficient: -0.212986151589174