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

 
Maxim Dmitrievsky:

Here we reindex bars by deadtime, because there may be missed bars in the history, so there are no holes. Then empty values are discarded, and then they are detrended by the MA.

There are no omissions in the trader, since n last bars are taken. They should not be reversed.

I don't think it would affect anything. I don't think it would make much difference. But I can re-do it and see.

Well, not remake, but just print and compare with the original - whether the direction is not broken
 
Kind of like what was written here, that predicting a past unknown bar is easier than a future one
 
elibrarius:
Well not redo, but just print and compare with the original - if the direction is not broken
...        ...      ...
3267  0.001091  1.18140
3268  0.000421  1.18077
3269  0.001455  1.18191
3270  0.001636  1.18225
3271  0.001829  1.18258

[3258 rows x 2 columns]
>>>
...        ...      ...
3225  0.001091  1.18140
3226  0.000421  1.18077
3227  0.001455  1.18191
3228  0.001636  1.18225
3229  0.001829  1.18258

[3230 rows x 2 columns]

It's ok, the last value corresponds to the price of the last bar in the terminal

 

I will share my experience - when using OHLC values of the current bar of the upper TF on the minute bar, ensure the stability of the data obtained, it may be critical in the application of the model, because no one can guarantee that the price is obtained without taking into account the OHLC accumulation of the current minute bar.

I have made a function that solves this problem.

//+------------------------------------------------------------------+
//|Получение информации о ценах OHLC текущего бара                   |
//+------------------------------------------------------------------+
void Get_OHLC(string symbol,ENUM_TIMEFRAMES TF, double &arr_OHLC[])
{
   ArrayResize(arr_OHLC,4);
   arr_OHLC[0]=iOpen(symbol,TF,0);
   arr_OHLC[3]=iOpen(symbol,PERIOD_M1,0);
   if(TF!=PERIOD_M1)
   {
      double arr_High[];
      double arr_Low[];
      int copied=0;
      datetime s=iTime(symbol,TF,0);
      datetime f=iTime(symbol,PERIOD_M1,1);
      if(s<f)
      {
         copied=CopyHigh(symbol,PERIOD_M1,s,f,arr_High);
         if (copied>0)
         {
            arr_OHLC[1]=arr_High[ArrayMaximum(arr_High,0,WHOLE_ARRAY)];
         }
         else
         {
            Print("Ошибка копирования в массив arr_High");
         }
         copied=CopyLow(symbol,PERIOD_M1,s,f,arr_Low);
         if (copied>0)
         {
            arr_OHLC[2]=arr_Low[ArrayMinimum(arr_Low,0,WHOLE_ARRAY)];
         }
         else
         {
            Print("Ошибка копирования в массив arr_Low");
         }
      }
      else
      {
         if(s==f)//Если ТФ открылся на прошлом минутном баре
         {
            arr_OHLC[1]=iHigh(symbol,PERIOD_M1,1);
            arr_OHLC[2]=iLow(symbol,PERIOD_M1,1);
         }
         if(s>f)//Если ТФ открылся на текущем минутном баре
         {
            arr_OHLC[1]=iOpen(symbol,PERIOD_M1,0);
            arr_OHLC[2]=iOpen(symbol,PERIOD_M1,0);
         }
      }
   }
   else
   {
      arr_OHLC[0]=iOpen(symbol,PERIOD_M1,0);
      arr_OHLC[1]=iOpen(symbol,PERIOD_M1,0);
      arr_OHLC[2]=iOpen(symbol,PERIOD_M1,0);
      arr_OHLC[3]=iOpen(symbol,PERIOD_M1,0);
   }
}
 
Aleksey Vyazmikin:

I will share my experience - when using OHLC values of the current bar of the upper TF on the minute bar, ensure the stability of the data obtained, it may be critical in the application of the model, because no one can guarantee that the price is obtained without taking into account the OHLC accumulation of the current minute bar.

I have made a function that solves this problem.

Is it a terminal bug or what?
I thought that with the first tick e.g. at 0:00 on Monday, all the bars up to one week will automatically appear.

If this is a bug - send a request with description and code to servicedek for replaying. In the next release will be fixed.

 
elibrarius:

Is it a terminal bug or what?
I thought that the first tick for example at 0:00 on Monday will automatically appear all the bars up to the weekly one.

If this is a bug - send a request with description and code to servicedek for replaying. In the next release will be fixed.

The bar will not open until a tick comes for the instrument. There may be no tick for a very long time ;-)

 
elibrarius:

Is it a terminal bug or what?
I thought that the first tick for example at 0:00 on Monday will automatically appear all the bars up to the weekly one.

If this is a bug - send a request with description and code to servicedek for replaying. In the next release will be fixed.

This is a bug, not a bug.

The situation may be as follows: a new tick of a new minute bar arrives and we use an indicator that has not calculated from the first tick and skips the tick, or simply enters the calculation of all predictors, goes to this time and in the middle of the code asks for the OHLC of the current bar. OHLC changes all the time and it may be critical in case of MO. Just came across different calculation of predictors myself depending on the type of tick modeling, and in fact when applying the model to the market.

 

on the terminology, please advise,

"predictor" is just one of the elements (one of the values) of the vector that is fed to the training?
just a bunch of names about the same thing.

 

Sorry for the insolence!

You can also run this data through neural networks, if you have free time of course.


EURUSD_options - this file contains all possible variants that can be in the time series.


EURUSD_data - the time series itself (the last received value is at the end of the file).

There are three columns, the first one is what should be predicted, the other two are variants of answers.

In fact, we need to teach NS to choose the right variant out of two. If it is possible to predict the next value of columns with variants of answers, that's also ok.

Files:
 
Evgeny Dyuka:

on the terminology, please advise,

"predictor" is just one of the elements (one of the values) of the vector that is fed to the training?
just a bunch of names about the same thing.

Yes. Synonyms are fetch, input, predictor.
Reason: