Machine learning in trading: theory, models, practice and algo-trading - page 2001

 
mytarmailS:

Ahh, well then forget what I wrote, in my language i+1 is the future


Then you'll have to refer to this picture.


I got it. x[,10] is 1 , x[,1] is 10.

 
int ForecastSum = 0;

int ForecastStart = 1;

if(X[ForecastStart] <= -0.025 && X[ForecastStart] > -0.08201612905){ForecastSum++;}
if(X[ForecastStart + 1] > -0.057983871 && X[ForecastStart + 1] <= -0.01129032255 && X[ForecastStart] > 0.0219354839){ForecastSum--;}
if(X[ForecastStart + 1] <= -0.057983871){ForecastSum++;}
if(X[ForecastStart + 1] > 0.0702419355){ForecastSum--;}
if(X[ForecastStart + 2] > 0.01362903225 && X[ForecastStart + 2] <= 0.0564516129 && X[ForecastStart + 1] > 0.00153225805){ForecastSum--;}
if(X[ForecastStart + 2] <= 0.0564516129 && X[ForecastStart + 2] > -0.01153225805 && X[ForecastStart + 1] <= 0.0040322581 && X[ForecastStart] <= -0.00596774195){ForecastSum--;}
if(X[ForecastStart + 2] > -0.03370967745 && X[ForecastStart + 2] <= -0.00403225805 && X[ForecastStart] > 0.00032258065){ForecastSum++;}
if(X[ForecastStart + 2] <= -0.03370967745 && X[ForecastStart] > 0.02814516125){ForecastSum--;}
if(X[ForecastStart + 3] > -0.025 && X[ForecastStart + 3] <= -0.00403225805 && X[ForecastStart + 2] > -0.03370967745){ForecastSum++;}
if(X[ForecastStart + 2] > -0.0266935484 && X[ForecastStart + 2] <= -0.025){ForecastSum--;}
if(X[ForecastStart + 1] > 0.0091129032 && X[ForecastStart + 1] <= 0.0277419355 && X[ForecastStart] <= -0.00096774195){ForecastSum++;}
if(X[ForecastStart + 1] <= 0.0564516129 && X[ForecastStart + 1] > 0.03935483875){ForecastSum++;}
if(X[ForecastStart + 2] > 0.02346774195 && X[ForecastStart + 1] > -0.057983871 && X[ForecastStart + 1] <= -0.0212903226){ForecastSum--;}
if(X[ForecastStart + 2] > -0.03370967745 && X[ForecastStart + 2] <= 0.0233870968 && X[ForecastStart + 1] <= 0.0233870968 && X[ForecastStart] > 0.0091129032 && X[ForecastStart] <= 0.02766129035){ForecastSum++;}
if(X[ForecastStart + 2] > -0.03370967745 && X[ForecastStart + 1] <= -0.00120967745 && X[ForecastStart] > -0.00596774195 && X[ForecastStart] <= 0.0229032258){ForecastSum++;}
if(X[ForecastStart] > 0.0012903226){ForecastSum--;}
if(X[ForecastStart + 9] == X[ForecastStart + 9]){ForecastSum++;}

I did so, ran it through the array with the data, it turned out 50/50.

Maxim's picture was cooler.

 
Evgeniy Chumakov:

I did so, ran it through the array with the data, it turned out 50/50.

Maksim's picture was cooler.

There's a mistake in your code somewhere, that's why it turns out to be rubbish.

It should be +- 98%

like your Maxim's))


============================

I trained it on the first 5k of data, the last thousand for the test.

This is how this model should work +-

 ###  тест на нов. данных
Reference
Prediction  -1   1
        -1 619   4
        1    1 565
                                          
               Accuracy : 0.9958          
                 95% CI : (0.9902, 0.9986)
    No Information Rate : 0.5214          
    P-Value [Acc > NIR] : <2 e-16          
                                      


But this result doesn't happen, either you messed up the data or the data are distorted so that the forecast has no value...

By the way what did you do with the data?

 
condition                                                                                                       
 
[1,] "X[,10]<=-0.025 & X[,10]>-0.08201612905"                                                                        
                                                                          
      pred
 [1,] "1" 


The top is like yours, the bottom is like mine.


int ForecastSum = 0;

int ForecastStart = 1;

if(X[ForecastStart] <= -0.025 && X[ForecastStart] > -0.08201612905){ForecastSum++;}

ForecastSum is what I add 1 to or subtract 1 from.

ForecastStart - is what bar I start with (shift), forecast bar at 0 counting.


I sometimes get a forecast value of 0.

 
Evgeniy Chumakov:


The top is like yours, the bottom is like mine.


ForecastSum is what I add 1 to or subtract 1 from.

ForecastStart - is what bar I start with (shift), forecast bar at 0 counting.


Sometimes I get the forecast value equal to 0.

I don't understand.

I have X[,1] ...... X[,10]

you have a value range of 10 i.e. from 1 to 10

and you have a forecaststart from 1 to 9.

why? )

 
mytarmailS:

I don't understand.

I have X[,1] ...... X[,10]

you have a value range of 10 i.e. from 1 to 10

and you have a forecaststart from 1 to 9.

why? )

ForecastStart + 9

1 (start bar) + 9 = 10;


array[cell number] - this is how it works in mt4.

 
In the file that I posted the first line in the beginning is the last coming time value. It is located in the 0 cell of the array, then go cells 1,2,3,4,5,6,7,8, etc.
 
Evgeniy Chumakov:

1 (start bar) + 9 = 10;


array[cell number] - in mt4 this is the case.


But the range itself is nine

ForecastStart <- 1:9

ForecastStart
 1 2 3 4 5 6 7 8 9

length(ForecastStart)
9
 
Evgeniy Chumakov:
In the file that I posted the first line in the beginning is the last coming time value. It is located in the 0 cell of the array, then go cells 1,2,3,4,5,6,7,8, etc.

Yeprst))))) who does that? ))))

I'll just change it.)

 

массив[0],[1],[2],[3],...[n]

you need to predict cell 0.

ForecastStart is not a range, but an offset. That is, I start with cell 1. Where x[ForecastStart + 9] = 10 array cell.

Therefore, the range is from cell 1 to 10.

Reason: