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

 
elibrarius:
Yes. Synonyms are fic, input, predictor.
Thanks, I've always had "fiches", although the word is crooked
 
Evgeny Dyuka:
thanks, I've always had "chips", although the word is crooked

even nasty....

the most correct word in my opinion is" features". but there are a lot of synonyms, and not the best.

elibrarius:
Yes. Synonyms are fic, input, predictor.
 
Evgeny Dyuka:
thank you, I have always had "chips", although the word is crooked

Especially when you're not familiar with transliteration.

 
Maxim Kuznetsov:

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

And this problem, alas, is not fully solved in the code. Any ideas how it can be solved in such a way that it would be possible to receive the same data from a symbol on which the EA is not located in OHLC modeling mode and in "Every tick is based on real ticks" mode? In general, do you have any idea how to solve the problem of synchronization without delays in OHLC, i.e., if there is no bar on another symbol yet, then we use the previous bar data? If we check all ticks, we can (though I haven't tried it) receive data of the first tick in the bar and be sure of synchronization using it, i.e. know if there was a bar on the current chart at the moment of a new bar opening or not.

 
Aleksey Vyazmikin:

This problem, alas, is not completely solved in the code. Are there any ideas how it can be solved so that it would be possible to receive the same data from a symbol, on which the EA is not located, both in OHLC mode and in "Every tick based on real ticks" mode? In general, do you have any idea how to solve the problem of synchronization without delays in OHLC, i.e., if there is no bar on another symbol yet, then we use the previous bar data? If we check all ticks, then it's possible (though I haven't tried it) to obtain data of the first tick in the bar and be sure of synchronization using it, i.e. if there was a bar on the current chart at the opening of a new one, or not.

It may even miss some minute bars. Form a bar at the Close price of the previous one. It will help to analyze the joint behavior of several symbols. It probably does not matter for one currency pair.
 
elibrarius:
Can even miss several minute bars. Form a bar at the Close price of the previous one. It will be good for analysis of combined behavior of several symbols. It probably does not matter for one currency.

Thus, the previous bar will be unsynchronized, while it may be the previous one in real trading.

 

I will leave it here for those who did not know that OHLC mode is unsynchronized symbol time series.


Forum on trading, automated trading systems and strategy testing

New version of MetaTrader 5 build 2615: Fundamental Analysis and Complex Criteria in Strategy Tester

Aleksey Vyazmikin, 2020.09.26 13:26


Build 2622, 1-minute timeframe, tool Si-12.20 broker "Otkrytie".

Printed at the opening of a new bar in the mode"Every tick based on the real ticks" and "OHLC on M1". :

Print("Time",TimeToString(iTime(Symbol(),PERIOD_CURRENT,0),TIME_DATE|TIME_MINUTES), " Time_TOM=",TimeToString(iTime("USDRUB_TOM",PERIOD_CURRENT,0),TIME_DATE|TIME_MINUTES));

Above results are tabulated and I have questions about them:

1. I expected that the delay may be if there is a new bar for the current symbol, and there is no such a situation for the instrument, but only at opening of a new day - it is highlighted in green.

2) The situation is the same as in the first paragraph, but if it is expected in the Potik testing, then why this situation happens in the"OHLC on M1" mode as well- it is unclear why there is a desynchronization.

3. the situation is marked yellow if two ticks are received at the same time or the tick for the requested symbol is faster than for the symbol from which the information is called, but how come there is no tick on this bar in the "OHLC on M1" mode , if it has already arrived in the tickwise mode.

I ask the developers to clarify, was this the intention, then what is the logic, or is this a bug that will be fixed?


Response:

Forum on trading, automated trading systems and testing trading strategies

New version of the MetaTrader 5 platform build 2615: Fundamental Analysis and Complex Criterion in the Strategy Tester

Renat Fatkhullin, 2020.09.26 13:33

Your question is only about the OHLC mode of testing, because everything is correct in the poticky mode?

The answer is simple - you can't have any guarantees of accurate synchronization of foreign characters in OHLC testing. OHLC is exclusively for dirty testing.


 

Seems to have solved the problem of out-of-sync when requesting data from another symbol - I had to sacrifice one minute bar in some cases, but a stable result in the simulation for all ticks and OHLC, and therefore the same is expected in real trading.

//+------------------------------------------------------------------+
//|Получение информации о ценах 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);
   datetime s=iTime(symbol,TF,0);
   datetime f=iTime(symbol,PERIOD_M1,1);
   datetime Time_1=iTime(Symbol(),PERIOD_M1,1);

   if(TF!=PERIOD_M1)
   {
      double arr_High[];
      double arr_Low[];
      int copied=0;
      if(Symbol()!=symbol)//Если берем данные с другого символа, то проверяем синхронизацию - нужно, так как при открытии новой свечи на текущем символе данных можнт небыть на опрашиваемом символе
      {
         if(Time_1>f)//На текущем символе открылись раньше появления нового бара на запрашиваемом
         {
            f=iTime(symbol,PERIOD_M1,0);
            arr_OHLC[3]=iClose(symbol,PERIOD_M1,0);
         }
         else
         {
            arr_OHLC[3]=iClose(symbol,PERIOD_M1,1);
         }
         if(s>f)//Если текущий бар ТФ открылся раньше, чем минутный бар до которого включительно берем информацию OHLC
         {
            s=iTime(symbol,TF,1);
            arr_OHLC[0]=iOpen(symbol,TF,1);
         }
         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)
         {
            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);
      if(Symbol()!=symbol)
      {
         if(Time_1>iTime(symbol,PERIOD_M1,1))//Если не появился новый бар
         {
            arr_OHLC[0]=iOpen(symbol,PERIOD_M1,0);
            arr_OHLC[1]=iHigh(symbol,PERIOD_M1,0);
            arr_OHLC[2]=iLow(symbol,PERIOD_M1,0);
            arr_OHLC[3]=iClose(symbol,PERIOD_M1,0);
         }
         else//Если появился новый бар
         {
            arr_OHLC[0]=iOpen(symbol,PERIOD_M1,1);
            arr_OHLC[1]=iHigh(symbol,PERIOD_M1,1);
            arr_OHLC[2]=iLow(symbol,PERIOD_M1,1);
            arr_OHLC[3]=iClose(symbol,PERIOD_M1,1);
         }
      }
   }
}
 
For a normal robust algo, a small lag does not affect anything. (These are farfetched problems.)
 
Maxim Dmitrievsky:
For a normal robust algo a little lag does not affect anything. These are far-fetched problems.)

Where to get these "normal" ones? If during quantization hit a boundary between quantiles, then during training it may appear that just a difference of 1 quantile will lead to missed input for real. In general, I do not like it when I can not reproduce in the tester pro-trading of a closed day, so I identified the reason and began to eliminate it.

Reason: