MT5 y la velocidad en acción - página 63

 
fxsaber:

Estimados desarrolladores, ¿podrían informarme de cómo se calcula MQL_MEMORY_USED?

He hecho un cálculo de la memoria que ocupan todas las variables de EA.

Es menos del 10%. Si he entendido bien, MQL_MEMORY_USED incluye la caché del historial y la caché de CopyTicks. Pero sigue siendo mucho menos.

Al mismo tiempo, el Asesor Experto paralelo consume varias veces menos. Pero el principio es el mismo.

En general, ¿qué se incluye a este valor?


He guardado una plantilla con Expert Advisor y la he aplicado al mismo gráfico provocando la recarga. Lo he visto así.

El uso de la memoria ha cambiado en casi un orden de magnitud. Hasta ahora, es difícil explicar lo que significa.

Muchos programas tienen un efecto acumulativo de uso de memoria. Esto es un pecado de los navegadores y a veces incluso de Word. La Terminal también puede ser culpable de ello. Además, todos los registros se escriben por defecto y es fácil pasar una semana si tienes demasiadas acciones en un giga. Es un mal que hay que gestionar. Pero no está claro cómo.

 
Vladimir Pastushak:

¿Tal vez sepa cómo seleccionar mediante programación un instrumento financiero y no quedarse colgado durante mucho tiempo?

A través de un indicador

Особенности языка mql5, тонкости и приёмы работы
Особенности языка mql5, тонкости и приёмы работы
  • 2020.10.22
  • www.mql5.com
В данной теме будут обсуждаться недокументированные приёмы работы с языком mql5, примеры решения тех, или иных задач...
 

Foro sobre trading, sistemas de trading automatizados y pruebas de estrategias de trading

MT5 y Speed en acción

Renat Fatkhullin, 2020.10.14 04:15

Para el ticking masivo pon más memoria.

4gb (precio de 20 euros) no es bueno en 2020 cuando se trata de análisis e investigación.

Para los productos de mercado, este enfoque no es bueno en ninguna parte. Tenemos que evitar la retención de 10 segundos de datos innecesarios a través de dicha muleta.

      while (!IsStopped() && ::TerminalInfoInteger(TERMINAL_MEMORY_USED) > inMaxMemory)
      {
        Alert("::TerminalInfoInteger(TERMINAL_MEMORY_USED) = " + (string)::TerminalInfoInteger(TERMINAL_MEMORY_USED));
        
        Sleep(1000);
      }

Hacer un producto de mercado trivial en forma de un Market Screener no es realmente una tarea alcanzable para MT5 debido al excesivo consumo de memoria.

 
fxsaber:

Hacer un producto de mercado trivial en forma de Market Screener no es realmente una tarea alcanzable para la MT5 debido al excesivo consumo de memoria.

El terminal come mucha memoria después del lanzamiento.

Después de la ejecución del screener empezó a comer 2 gigas (TERMINAL_MEMORY_USED y no disminuyó con el tiempo). Esto es con un solo gráfico abierto para 5000 barras M1.


No se ha guardado una captura de pantalla. Pero decidió lanzar un ejemplo, que muestra la memoria comer Terminal no en sí mismo, donde es simplemente estúpido.

// Создание копий оригинальных символов из Обзора рынка в виде пользовательских.
#property script_show_inputs

input datetime inStartTime = D'2020.06.01'; // С какого времени закачивать тики

void OnStart()
{
  for (int i = SymbolsTotal(true) - 1; !IsStopped() && (i >= 0); i--)
  {
    const string Symb = SymbolName(i, true);
    
    if (!SymbolInfoInteger(Symb, SYMBOL_CUSTOM)) // Если символ не кастомный.
    {
      Alert(Symb + " - Start.");
      
      MqlTick Ticks[];
      
      if (CopyTicksRange(Symb, Ticks, COPY_TICKS_ALL, (long)inStartTime * 1000) > 0) // Взяли с него тики.
      {
        const string CustomSymb = "CUSTOM_" + Symb;
      
        if (SymbolInfoInteger(CustomSymb, SYMBOL_EXIST) || CustomSymbolCreate(CustomSymb, AccountInfoString(ACCOUNT_SERVER), Symb)) // Содали кастомный.
        {
          Alert((string)i + ": " + Symb + " - " + (string)CustomTicksReplace(CustomSymb, 0, LONG_MAX, Ticks)); // Поместили в него тики.
          
          SymbolSelect(CustomSymb, true);
        }
       }
    }
  }
}


El script sólo hace copias de los símbolos originales del Market Watch. Se supone que debo añadir todos los símbolos en MQ-Demo y ejecutar este script primero en frío y luego en caliente.

Y después de la ejecución en caliente (cuando los ticks ya están en SSD en forma de archivos tkc) observaré un enorme agotamiento de la memoria donde no es necesario en una implementación adecuada.


Sin embargo, al ejecutar el script, me he encontrado con que se cuelga en MQ-Demo. Sólo puede descargarse a través de la terminación anormal, tras la cual el Terminal no libera más de 1 GB de memoria.


Es fácil comparar esta captura de pantalla con la del principio.

 

Lo siento, no estoy seguro de si esto es un error o una característica. No he encontrado una respuesta por mi cuenta. Pero la pregunta está relacionada con el rendimiento y supongo que es mejor hacerla aquí.

Si añadimos, por ejemplo, 22 búferes de tipo DRAW_SECTION a un indicador vacío, entonces al inicio de dicho indicador para un gráfico que contenga 1000000 barras o más, el terminal se retrasa significativamente (provoca una carga importante de la CPU) y consume cantidades significativas de memoria, incluso si el indicador no calcula nada.

Mi interés se ha despertado por el hecho de que si se utilizan buffers con otros tipos, todo funciona sin problemas y no se observa esa ralentización.

Por ejemplo, he ejecutado el siguiente código en un solo gráfico con 1000000 barras y ha consumido unos 500 MBytes y se retrasa, sobre todo el propio gráfico.

#property indicator_chart_window

#property indicator_buffers   22
#property indicator_plots     22

#property indicator_type1     DRAW_SECTION
#property indicator_type2     DRAW_SECTION
#property indicator_type3     DRAW_SECTION
#property indicator_type4     DRAW_SECTION
#property indicator_type5     DRAW_SECTION
#property indicator_type6     DRAW_SECTION
#property indicator_type7     DRAW_SECTION
#property indicator_type8     DRAW_SECTION
#property indicator_type9     DRAW_SECTION
#property indicator_type10     DRAW_SECTION
#property indicator_type11     DRAW_SECTION
#property indicator_type12     DRAW_SECTION
#property indicator_type13     DRAW_SECTION
#property indicator_type14     DRAW_SECTION
#property indicator_type15     DRAW_SECTION
#property indicator_type16     DRAW_SECTION
#property  indicator_type17     DRAW_SECTION
#property  indicator_type18     DRAW_SECTION
#property  indicator_type19     DRAW_SECTION
#property  indicator_type20     DRAW_SECTION
#property  indicator_type21     DRAW_SECTION
#property  indicator_type22     DRAW_SECTION

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnInit()
{  
   return INIT_SUCCEEDED;   
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{
   return rates_total;
}

Pero si cambio el tipo de búfer a, por ejemplo, DRAW_LINE, la carga del procesador se reduce drásticamente, no se observan retrasos y la memoria consume 5 veces menos (unos 100 MBytes consumidos).

#property indicator_chart_window

#property indicator_buffers   22
#property indicator_plots     22

#property indicator_type1     DRAW_LINE
#property indicator_type2     DRAW_LINE
#property indicator_type3     DRAW_LINE
#property indicator_type4     DRAW_LINE
#property indicator_type5     DRAW_LINE
#property indicator_type6     DRAW_LINE
#property indicator_type7     DRAW_LINE
#property indicator_type8     DRAW_LINE
#property indicator_type9     DRAW_LINE
#property indicator_type10     DRAW_LINE
#property indicator_type11     DRAW_LINE
#property indicator_type12     DRAW_LINE
#property indicator_type13     DRAW_LINE
#property indicator_type14     DRAW_LINE
#property indicator_type15     DRAW_LINE
#property indicator_type16     DRAW_LINE
#property  indicator_type17     DRAW_LINE
#property  indicator_type18     DRAW_LINE
#property  indicator_type19     DRAW_LINE
#property  indicator_type20     DRAW_LINE
#property  indicator_type21     DRAW_LINE
#property  indicator_type22     DRAW_LINE

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnInit()
{  
   return INIT_SUCCEEDED;   
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{
   return rates_total;
}   

Se hicieron pruebas similares en diferentes builds, hasta la de 2019 y la situación es la misma.

Agradecería saber a qué se debe esto y si es normal, en principio.
 
fxsaber:

Un ciudadano particular sacó de sus amplios pantalonesun duplicado de una carga inestimable de código MQL, que demostró que en las mismas condiciones la muleta funcionaba más rápido que la función normal.

Una prueba muy sencilla:

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTick()
  {
   TestSymbolInfoTick();
   TestPositionSelectByTicket();
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void TestSymbolInfoTick()
  {
   MqlTick Tick;
//---
   ulong start,end,max_time=0,avr_time=0,counter=0;
   int   count=100000;
   for(int i=0; i<count; i++)
     {
      start=GetMicrosecondCount();
      SymbolInfoTick(_Symbol, Tick);
      end=GetMicrosecondCount()-start;
      //---
      if(end>max_time)
         max_time=end;
      if(end>100)
        {
         avr_time+=end;
         counter++;
        }
     }
   Print("SymbolInfoTick max bad time: ",DoubleToString(max_time/1000.0,3)," ms; avr bad time: ",counter ? DoubleToString(avr_time/1000.0/counter,3):"0"," ms; bad iterations: ",counter," total iterations: ",count);
  }  
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void TestPositionSelectByTicket()
  {
//---
   ulong start,end,max_time=0,avr_time=0,counter=0;
   int   count=100000;
   for(int i=0; i<count; i++)
     {
      start=GetMicrosecondCount();
      GetBid();
      end=GetMicrosecondCount()-start;
      //---
      if(end>max_time)
         max_time=end;
      if(end>100)
        {
         avr_time+=end;
         counter++;
        }
     }
   Print("GetBid max bad time: ",DoubleToString(max_time/1000.0,3)," ms; avr bad time: ",counter ? DoubleToString(avr_time/1000.0/counter,3):"0"," ms; bad iterations: ",counter," total iterations: ",count);
  }

20 Asesores Expertos en EURUSD, es decir, todos los procesos OnTick simultáneamente. La construcción de la terminal es 2664. La prueba se ejecuta sin optimización, compilación y otra carga adicional al 100% de la CPU - no vas a ejecutar un comercio real "hft" en este fondo, ¿verdad?

Típico registro de pruebas:

2020.10.29 11:10:49.133 SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 28.004 ms; avr bad time: 0.393 ms; bad iterations: 1569 total iterations: 100000
2020.10.29 11:10:49.136 SymbolInfoTick (EURUSD,H1)      GetBid max bad time: 4.795 ms; avr bad time: 0.361 ms; bad iterations: 1783 total iterations: 100000
2020.10.29 11:10:49.137 SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 25.367 ms; avr bad time: 0.425 ms; bad iterations: 1496 total iterations: 100000
2020.10.29 11:10:49.138 SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 2.681 ms; avr bad time: 0.352 ms; bad iterations: 1804 total iterations: 100000
2020.10.29 11:10:49.139 SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 4.264 ms; avr bad time: 0.370 ms; bad iterations: 1734 total iterations: 100000
2020.10.29 11:10:49.142 SymbolInfoTick (EURUSD,H1)      GetBid max bad time: 7.049 ms; avr bad time: 0.362 ms; bad iterations: 1803 total iterations: 100000
2020.10.29 11:10:49.142 SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 13.376 ms; avr bad time: 0.365 ms; bad iterations: 1754 total iterations: 100000
2020.10.29 11:10:49.144 SymbolInfoTick (EURUSD,H1)      GetBid max bad time: 18.048 ms; avr bad time: 0.417 ms; bad iterations: 1516 total iterations: 100000
2020.10.29 11:10:49.144 SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 21.280 ms; avr bad time: 0.372 ms; bad iterations: 1769 total iterations: 100000
2020.10.29 11:10:53.837 SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 0.631 ms; avr bad time: 0.143 ms; bad iterations: 205 total iterations: 100000
2020.10.29 11:10:53.837 SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 0.517 ms; avr bad time: 0.134 ms; bad iterations: 170 total iterations: 100000
2020.10.29 11:10:53.837 SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 0.483 ms; avr bad time: 0.144 ms; bad iterations: 178 total iterations: 100000
2020.10.29 11:10:53.838 SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 0.517 ms; avr bad time: 0.147 ms; bad iterations: 182 total iterations: 100000
2020.10.29 11:10:53.844 SymbolInfoTick (EURUSD,H1)      SymbolInfoTick max bad time: 0.582 ms; avr bad time: 0.134 ms; bad iterations: 165 total iterations: 100000
2020.10.29 11:10:53.845 SymbolInfoTick (EURUSD,H1)      SymbolInfoTick max bad time: 0.518 ms; avr bad time: 0.137 ms; bad iterations: 195 total iterations: 100000
2020.10.29 11:10:53.845 SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 0.530 ms; avr bad time: 0.139 ms; bad iterations: 160 total iterations: 100000
2020.10.29 11:10:53.846 SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 0.575 ms; avr bad time: 0.138 ms; bad iterations: 143 total iterations: 100000
2020.10.29 11:10:53.848 SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 0.593 ms; avr bad time: 0.143 ms; bad iterations: 206 total iterations: 100000
2020.10.29 11:10:53.849 SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 0.446 ms; avr bad time: 0.138 ms; bad iterations: 147 total iterations: 100000
2020.10.29 11:10:53.850 SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 0.661 ms; avr bad time: 0.146 ms; bad iterations: 191 total iterations: 100000
2020.10.29 11:10:53.850 SymbolInfoTick (EURUSD,H1)      SymbolInfoTick max bad time: 0.471 ms; avr bad time: 0.141 ms; bad iterations: 219 total iterations: 100000
2020.10.29 11:10:53.851 SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 0.442 ms; avr bad time: 0.137 ms; bad iterations: 198 total iterations: 100000
2020.10.29 11:10:53.851 SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 0.574 ms; avr bad time: 0.140 ms; bad iterations: 215 total iterations: 100000
2020.10.29 11:10:53.853 SymbolInfoTick (EURUSD,H1)      SymbolInfoTick max bad time: 0.507 ms; avr bad time: 0.140 ms; bad iterations: 222 total iterations: 100000
2020.10.29 11:10:53.857 SymbolInfoTick (EURUSD,H1)      SymbolInfoTick max bad time: 0.776 ms; avr bad time: 0.165 ms; bad iterations: 341 total iterations: 100000
2020.10.29 11:10:53.858 SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 0.568 ms; avr bad time: 0.156 ms; bad iterations: 381 total iterations: 100000
2020.10.29 11:10:53.860 SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 0.896 ms; avr bad time: 0.164 ms; bad iterations: 293 total iterations: 100000
2020.10.29 11:10:53.861 SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 6.124 ms; avr bad time: 0.178 ms; bad iterations: 219 total iterations: 100000
2020.10.29 11:10:53.862 SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 0.794 ms; avr bad time: 0.164 ms; bad iterations: 356 total iterations: 100000
2020.10.29 11:10:54.686 SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 4.870 ms; avr bad time: 0.339 ms; bad iterations: 1575 total iterations: 100000
2020.10.29 11:10:54.728 SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 6.442 ms; avr bad time: 0.343 ms; bad iterations: 1691 total iterations: 100000
2020.10.29 11:10:54.732 SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 7.568 ms; avr bad time: 0.349 ms; bad iterations: 1671 total iterations: 100000
2020.10.29 11:10:54.755 SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 13.354 ms; avr bad time: 0.365 ms; bad iterations: 1634 total iterations: 100000
2020.10.29 11:10:54.773 SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 9.385 ms; avr bad time: 0.352 ms; bad iterations: 1734 total iterations: 100000
2020.10.29 11:10:54.778 SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 2.526 ms; avr bad time: 0.342 ms; bad iterations: 1748 total iterations: 100000
2020.10.29 11:10:54.785 SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 15.195 ms; avr bad time: 0.356 ms; bad iterations: 1708 total iterations: 100000
2020.10.29 11:10:54.790 SymbolInfoTick (EURUSD,H1)      GetBid max bad time: 5.180 ms; avr bad time: 0.347 ms; bad iterations: 1796 total iterations: 100000
 
Anton:

Una prueba muy sencilla:

20 EAs en EURUSD, es decir, todos los procesos OnTick al mismo tiempo. Terminal build 2664. La prueba se ejecuta sin optimización, compilación y otra carga de trabajo adicional en el 100% de la CPU - no vas a ejecutar un comercio real "hft" en este fondo, ¿verdad?

Típico registro de pruebas:

Se crean condiciones de invernadero haciendo 100K iteraciones durante 1,5 segundos en el mismo tick. Yo, en cambio, esperé a propósito los ticks que no generaron un OnTick.

Mirando mis registros de operaciones, me doy cuenta de la ejecución de SymbolInfoTick en unos pocos milisegundos. Y sé al 100% que la CPU estaba a pleno rendimiento en ese momento.


Es muy sencillo. Hay condicionalmente 1 millón de garrapatas al día. Incluso un 0,01% de ralentización de los ticks son 100 ticks al día con retrasos. Dirás que eso es una tontería. Diré que es malo. Si me encuentro con un retraso cuando tengo que hacer un pedido, es una pérdida monetaria potencial.


Se agradece mucho que esta rama no pase desapercibida, y en esta característica en particular, se ha trabajado mucho para agilizar las cosas. Sin embargo, me sorprendió un poco que la horrible muleta pudiera superar a la función normal en ciertas situaciones. Y tal vez si se ordenara y eliminara ese desfase, 100 desfases potenciales al día se convertirían en 10.


Yo digo que está mucho mejor que al principio del hilo. Pero el hecho es que hay veces que no es bueno. Y veo que no quieres investigarlo. Respeto su elección.


Arriba se citó la opción de la instantánea para obtener los precios actuales. Me convendría completamente si no cogiera lapsos de milisegundos en la máquina Idle-CPU.

También me preocupa no sólo la velocidad de SymbolInfoTick, sino también la relevancia de los precios que devuelve. Veo que no se plantea esta cuestión. Al parecer, decidiste mirarlo más tarde.

 
fxsaber:

Se crean condiciones de invernadero haciendo 100K iteraciones en 1,5 segundos en el mismo tick. Yo, en cambio, esperé específicamente a los ticks que no generaban OnTick.

Al revisar mis registros de operaciones, observo que SymbolInfoTick se ejecuta durante unos pocos milisegundos. Sé al 100% que la CPU estaba en reposo en ese momento.

Es muy sencillo. En un día hay condicionalmente 1 millón de garrapatas. Incluso un desfase del 0,01% son 100 ticks al día con desfases. Dirás que eso es una tontería. Diré que es malo. Si me encuentro con un retraso cuando tengo que hacer un pedido, es una pérdida monetaria potencial.

Se agradece mucho que esta rama no pase desapercibida, y en esta característica en particular, se ha trabajado mucho para agilizar las cosas. Sin embargo, me sorprendió un poco que la horrible muleta pudiera superar a la función normal en ciertas situaciones. Y tal vez si se ordenara y eliminara ese desfase, 100 desfases potenciales al día se convertirían en 10.

Yo digo que está mucho mejor que al principio del hilo. Pero el hecho es que hay veces que no es bueno. Y veo que no quieres investigarlo. Respeto su elección.

Arriba se citó la opción de la instantánea para obtener los precios actuales. Me convendría completamente si no cogiera lapsos de milisegundos en la máquina Idle-CPU.

También me preocupa no sólo la velocidad de SymbolInfoTick, sino también la relevancia de los precios que devuelve. Veo que no se plantea esta cuestión. Al parecer, decidiste mirarlo más tarde.

Estas no son condiciones cálidas en absoluto. Un bucle para 100000 peticiones de precio sin Sleep() y similares y en 20 hilos simultáneamente es una prueba de estrés evidente. Nada de eso debería estar siquiera cerca en condiciones reales.

Si crees que no hay más ticks en 1,5 segundos - vale, haz 10 millones de consultas, no cambiará nada, tu "muleta" funciona peor:
NG      0       10:26:22.903    SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 2.223 ms; avr bad time: 0.146 ms; bad iterations: 22369 total iterations: 10000000
OK      0       10:26:22.934    SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 1.759 ms; avr bad time: 0.144 ms; bad iterations: 22462 total iterations: 10000000
KO      0       10:26:22.944    SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 4.587 ms; avr bad time: 0.145 ms; bad iterations: 22620 total iterations: 10000000
RS      0       10:26:23.443    SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 8.433 ms; avr bad time: 0.162 ms; bad iterations: 36242 total iterations: 10000000
LG      0       10:26:23.487    SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 9.660 ms; avr bad time: 0.163 ms; bad iterations: 36378 total iterations: 10000000
KH      0       10:26:23.492    SymbolInfoTick (EURUSD,H1)      SymbolInfoTick max bad time: 8.433 ms; avr bad time: 0.163 ms; bad iterations: 36208 total iterations: 10000000
HK      0       10:26:23.505    SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 14.355 ms; avr bad time: 0.164 ms; bad iterations: 36292 total iterations: 10000000
QN      0       10:27:26.728    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 18.589 ms; avr bad time: 0.373 ms; bad iterations: 122026 total iterations: 10000000
HQ      0       10:27:27.042    SymbolInfoTick (EURUSD,H1)      GetBid max bad time: 15.544 ms; avr bad time: 0.371 ms; bad iterations: 123026 total iterations: 10000000
RD      0       10:27:29.190    SymbolInfoTick (EURUSD,H1)      GetBid max bad time: 16.207 ms; avr bad time: 0.370 ms; bad iterations: 127228 total iterations: 10000000
QJ      0       10:27:32.661    SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 7.465 ms; avr bad time: 0.495 ms; bad iterations: 994 total iterations: 10000000
CL      0       10:27:32.799    SymbolInfoTick (EURUSD,H1)      SymbolInfoTick max bad time: 16.999 ms; avr bad time: 0.585 ms; bad iterations: 1081 total iterations: 10000000
EP      0       10:27:33.056    SymbolInfoTick (EURUSD,H1)      SymbolInfoTick max bad time: 11.774 ms; avr bad time: 0.515 ms; bad iterations: 1122 total iterations: 10000000
EE      0       10:27:33.555    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 17.385 ms; avr bad time: 0.368 ms; bad iterations: 134761 total iterations: 10000000
FG      0       10:27:35.581    SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 10.428 ms; avr bad time: 0.502 ms; bad iterations: 373 total iterations: 10000000
CJ      0       10:27:46.372    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 14.278 ms; avr bad time: 0.360 ms; bad iterations: 153668 total iterations: 10000000
QO      0       10:27:46.819    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 12.494 ms; avr bad time: 0.361 ms; bad iterations: 154170 total iterations: 10000000
KP      0       10:27:46.897    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 17.176 ms; avr bad time: 0.362 ms; bad iterations: 154258 total iterations: 10000000
PE      0       10:27:47.560    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 14.090 ms; avr bad time: 0.362 ms; bad iterations: 156325 total iterations: 10000000
LF      0       10:27:47.946    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 16.794 ms; avr bad time: 0.367 ms; bad iterations: 160557 total iterations: 10000000
IH      0       10:27:47.970    SymbolInfoTick (EURUSD,H1)      GetBid max bad time: 11.241 ms; avr bad time: 0.366 ms; bad iterations: 160307 total iterations: 10000000
KN      0       10:27:51.026    SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 4.961 ms; avr bad time: 0.333 ms; bad iterations: 687 total iterations: 10000000
FP      0       10:27:51.517    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 19.844 ms; avr bad time: 0.372 ms; bad iterations: 165266 total iterations: 10000000
LE      0       10:27:51.574    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 15.435 ms; avr bad time: 0.371 ms; bad iterations: 165785 total iterations: 10000000
QE      0       10:27:51.686    SymbolInfoTick (EURUSD,H1)      GetBid max bad time: 13.601 ms; avr bad time: 0.371 ms; bad iterations: 166278 total iterations: 10000000
CK      0       10:27:52.204    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 15.480 ms; avr bad time: 0.374 ms; bad iterations: 161441 total iterations: 10000000
FL      0       10:27:52.262    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 19.503 ms; avr bad time: 0.374 ms; bad iterations: 161363 total iterations: 10000000
FQ      0       10:27:52.504    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 15.440 ms; avr bad time: 0.375 ms; bad iterations: 161927 total iterations: 10000000
KQ      0       10:27:52.507    SymbolInfoTick (EURUSD,H1)      GetBid max bad time: 20.155 ms; avr bad time: 0.375 ms; bad iterations: 161670 total iterations: 10000000
EG      0       10:27:52.558    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 15.634 ms; avr bad time: 0.371 ms; bad iterations: 167511 total iterations: 10000000
OK      0       10:27:52.751    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 14.698 ms; avr bad time: 0.368 ms; bad iterations: 168482 total iterations: 10000000
LL      0       10:27:53.941    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 16.659 ms; avr bad time: 0.364 ms; bad iterations: 171194 total iterations: 10000000
JP      0       10:27:58.244    SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 12.019 ms; avr bad time: 0.308 ms; bad iterations: 970 total iterations: 10000000
OD      0       10:27:58.879    SymbolInfoTick (EURUSD,M15)     SymbolInfoTick max bad time: 7.972 ms; avr bad time: 0.299 ms; bad iterations: 1094 total iterations: 10000000
CE      0       10:28:06.402    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 14.140 ms; avr bad time: 0.342 ms; bad iterations: 56289 total iterations: 10000000
EK      0       10:28:06.860    SymbolInfoTick (EURUSD,H1)      GetBid max bad time: 14.013 ms; avr bad time: 0.344 ms; bad iterations: 56008 total iterations: 10000000
QL      0       10:28:06.922    SymbolInfoTick (EURUSD,H1)      GetBid max bad time: 11.626 ms; avr bad time: 0.343 ms; bad iterations: 56676 total iterations: 10000000
ER      0       10:28:07.010    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 13.021 ms; avr bad time: 0.340 ms; bad iterations: 51610 total iterations: 10000000
ER      0       10:28:08.708    SymbolInfoTick (EURUSD,M15)     GetBid max bad time: 2.970 ms; avr bad time: 0.317 ms; bad iterations: 24083 total iterations: 10000000

Esta su afirmación es 100% falsa:

Просматривая логи своей торговли, замечаю исполнение SymbolInfoTick в течение нескольких миллисекунд. При этом на 100% знаю, что в этот момент был полный Idle CPU.

Al igual que esta declaración anterior suya:

Уверен, что могу доказать, что получение текущих цен у Вас реализовано очень медленно. И CPU-нагрузка создает такие тормоза только из-за неправильной реализации Вами самой главной функции в MQL5.

El acceso a los precios a través de SymbolInfoTick es ahora muy rápido y está completamente desacoplado del procesamiento del flujo de ticks. Se trabaja con un caché de precios ya hecho, que se actualiza muy poco y rápidamente.

Todas las "ralentizaciones del 0,01% de la tasa de tick" sólo aparecen en condiciones de prueba de estrés, y eso es un gran resultado. En condiciones normales, se garantiza que el acceso sea muy rápido.

Si admite que "se ha trabajado mucho para agilizar" SymbolInfoTick, entonces debería creerme que la "muleta" de obtener los precios mediante PositionSelectByTicket no puede ser una solución mejor.

Por una simple razón - la implementación de PositionSelectByTicket es completamente idéntica a la implementación original "lenta" de SymbolInfoTick.

Como escribí anteriormente, esta implementación no es lenta en el sentido literal de la palabra, pero bajo una fuerte carga de la CPU, tiene una mayor probabilidad de que se produzcan valores atípicos en tiempo de ejecución (lo que es claramente visible en mi última prueba).

Los tiempos aquí dependen en gran medida del programador de tareas del sistema que se ejecuta bajo carga, es decir, puede haber diferencias de un sistema operativo a otro e incluso de una versión a otra.

Y cuanto más pesada sea la carga, más se probará el rendimiento del programador de tareas, no del terminal.

Este es el final del tema del rendimiento de SymbolInfoTick.

Si sus expertos crean una carga al nivel de las pruebas de estrés sintéticas, entonces hay una solución: "el hierro debe coincidir con las tareas".

 

Tengo una pregunta sobre la relevancia de los ticks dados por SymbolInfoTick.

Situación:

1. Hacemos TimeCurretn(); obtenemos la hora 18:00:00

2. Hacer SymbolInfoTick en un símbolo no etiquetado. Obtenemos una marca con la hora 17:58:00.

3. Dormir(1)

4. Añade un SymbolInfoTick para el símbolo no izquierdo. Obtenemos una marca con la hora 17:59:00.


Es decir, en el cuarto elemento tenemos un nuevo tick, que es un minuto diferente al de TimeCurretn().

¿Ves algún problema en esta situación?

¿Cómo llegar a esta situación con menos frecuencia?

 
pivomoe:

Tengo una pregunta sobre la relevancia de los ticks dados por SymbolInfoTick.

Situación:

1. Hacemos TimeCurretn(); obtenemos la hora 18:00:00

2. Hacer SymbolInfoTick en un símbolo no etiquetado. Obtenemos una marca con la hora 17:58:00.

3. Dormir(1)

4. Añade un SymbolInfoTick para el símbolo no izquierdo. Obtenemos una marca con la hora 17:59:00.


Es decir, en el cuarto elemento tenemos un nuevo tick, que es un minuto diferente al de TimeCurretn().

¿Ves algún problema en esta situación?

¿Cómo llegar a esta situación con menos frecuencia?

SymbolInfoTick envía los datos recibidos del servidor del corredor. Lo que el servidor envió es lo que se obtiene.

Si tiene alguna duda sobre el flujo de ticks que emite su corredor, debe ponerse en contacto con él.