MT5 e la velocità in azione - pagina 63

 
fxsaber:

Cari sviluppatori, potreste informarmi come viene calcolato MQL_MEMORY_USED?

Ho fatto un calcolo della memoria che tutte le variabili EA occupano.

È meno del 10%. Se ho capito bene, MQL_MEMORY_USED include la cache History e la cache CopyTicks. Ma è ancora molto meno.

Allo stesso tempo, l'Expert Advisor parallelo consuma diverse volte meno. Ma il principio è lo stesso.

In generale, cosa è incluso in questo valore?


Ho salvato un modello con Expert Advisor e l'ho applicato allo stesso grafico causando il ricaricamento. L'ho visto così.

L'uso della memoria è cambiato di quasi un ordine di grandezza. Finora è difficile spiegarne il significato.

Molti programmi hanno un effetto cumulativo di utilizzo della memoria. Questo è un peccato dei browser e a volte anche di Word. Anche il terminale può essere colpevole di questo. Inoltre, tutti i log sono scritti di default ed è facile passare una settimana se si hanno troppe azioni in un giga. Questo è un male che deve essere gestito. Ma non è chiaro come.

 
Vladimir Pastushak:

Forse sapete come selezionare programmaticamente uno strumento finanziario e non rimanere bloccati per secoli?

Attraverso un indicatore

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

Forum sul trading, sistemi di trading automatico e test di strategie di trading

MT5 e la velocità in azione

Renat Fatkhullin, 2020.10.14 04:15

Per il ticchettio di massa mettete più memoria.

4gb (prezzo €20) non vanno bene nel 2020 quando si tratta di analisi e ricerca.

Per i prodotti di mercato questo approccio non va bene da nessuna parte. Dobbiamo bypassare la conservazione di 10 secondi di dati inutili attraverso una tale stampella.

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

Fare un banale prodotto di mercato sotto forma di un Market Screener non è in realtà un compito realizzabile per MT5 a causa dell'eccessivo consumo di memoria.

 
fxsaber:

Realizzare un banale prodotto di mercato sotto forma di Market Screener non è in realtà un compito realizzabile per la MT5 a causa dell'eccessivo consumo di memoria.

Il terminale mangia così tanta memoria dopo il lancio.

Dopo l'esecuzione dello screener ha iniziato a mangiare 2 giga (TERMINAL_MEMORY_USED e non è diminuito con il tempo). Questo con un solo grafico aperto per 5000 barre M1.


Non ha salvato uno screenshot. Ma ha deciso di gettare un esempio, che mostra la memoria mangiare terminale non in sé, dove è solo stupido.

// Создание копий оригинальных символов из Обзора рынка в виде пользовательских.
#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);
        }
       }
    }
  }
}


Lo script fa semplicemente delle copie dei simboli originali del Market Watch. Dovevo aggiungere tutti i simboli su MQ-Demo ed eseguire questo script la prima volta a freddo e poi di nuovo a caldo.

E dopo l'esecuzione a caldo (quando i tick sono già su SSD sotto forma di file tkc) osserverò un enorme esaurimento della memoria dove non è necessario in una corretta implementazione.


Tuttavia, eseguendo lo script, ho riscontrato che si blocca su MQ-Demo. Può essere scaricato solo attraverso la terminazione anomala, dopo la quale il terminale non rilascia più di 1 GB di memoria.


È facile confrontare questa schermata con quella dell'inizio.

 

Scusa, non sono sicuro se questo è un bug o una caratteristica. Non ho trovato una risposta da solo. Ma la domanda è legata alla performance e suppongo sia meglio farla qui.

Se aggiungiamo, per esempio, 22 buffer di tipo DRAW_SECTION a un indicatore vuoto, allora all'avvio di tale indicatore per un grafico contenente 1000000 barre o più il terminale ritarda notevolmente (causa un carico significativo della CPU) e mangia quantità significative di memoria, anche se l'indicatore non calcola nulla.

Il mio interesse è stato suscitato dal fatto che se si usano buffer con altri tipi, tutto funziona senza problemi e non si osserva tale rallentamento.

Per esempio, ho eseguito il seguente codice su un singolo grafico con 1000000 barre e ha consumato circa 500 MByte e ritarda, soprattutto il grafico stesso.

#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;
}

Ma se cambio il tipo di buffer a, diciamo, DRAW_LINE, il carico sul processore si riduce drasticamente, non si osservano ritardi e la memoria consuma 5 volte meno (circa 100 MByte consumati).

#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;
}   

Test simili sono stati fatti su diverse build, fino alle build 2019 e la situazione è la stessa.

Sarei grato di sapere di cosa si tratta e se è normale, in linea di principio?
 
fxsaber:

Un singolo cittadino ha tirato fuori dai suoi larghi pantaloniun duplicato di un prezioso carico di codice MQL, che mostrava che nelle stesse condizioni la stampella lavorava più velocemente della funzione regolare.

Un test molto semplice:

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
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 Expert Advisors su EURUSD, cioè tutti i processi OnTick simultaneamente. La costruzione del terminale è 2664. Il test viene eseguito senza ottimizzazione, compilazione e altri carichi aggiuntivi al 100% della CPU - non hai intenzione di eseguire un vero commercio "hft" su questo sfondo, vero?

Tipico registro di test:

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:

Un test molto semplice:

20 EAs su EURUSD, cioè tutti i processi OnTick allo stesso tempo. Terminale build 2664. Il test viene eseguito senza ottimizzazione, compilazione e altri carichi di lavoro aggiuntivi sul 100% della CPU - non hai intenzione di eseguire un vero e proprio trading "hft" su questo sfondo, vero?

Tipico registro di test:

Si creano condizioni da serra facendo 100K iterazioni per 1,5 secondi sullo stesso tick. Io, invece, ho aspettato di proposito i tick che non generavano un OnTick.

Guardando i miei log di trading, noto l'esecuzione di SymbolInfoTick in pochi millisecondi. E so per certo al 100% che la CPU era in pieno Idle in quel momento.


È molto semplice. Ci sono condizionatamente 1 milione di zecche al giorno. Anche lo 0,01% di rallentamento dei tic è di 100 tic al giorno con ritardi. Direte che è una sciocchezza. Dirò che è brutto. Se mi imbatto in un ritardo quando devo fare un ordine, è una potenziale perdita monetaria.


Molto grato che questo ramo non passi inosservato, e su questa caratteristica in particolare, è stato fatto un sacco di lavoro per accelerare le cose. Tuttavia, è stata un po' una sorpresa per me che la stampella terribile potesse superare la funzione regolare in certe situazioni. E forse, se lo risolvesse ed eliminasse quel ritardo, 100 potenziali ritardi al giorno diventerebbero 10.


Io dico che è molto meglio che all'inizio del thread. Ma resta il fatto che ci sono momenti in cui non va bene. E vedo che non vuoi indagare. Rispetto la vostra scelta.


Sopra ha citato l'opzione istantanea per ottenere i prezzi attuali. Mi andrebbe benissimo se non beccasse ritardi di millisecondi sulla macchina Idle-CPU.

Sono anche preoccupato non solo per la velocità di SymbolInfoTick, ma anche per la rilevanza dei prezzi che restituisce. Vedo che non sollevate questa questione. A quanto pare hai deciso di guardarlo dopo.

 
fxsaber:

Si creano condizioni da serra facendo 100K iterazioni entro 1,5 secondi sullo stesso tick. Io, d'altra parte, ho aspettato specificamente i tick che non hanno generato OnTick.

Quando esamino i miei log di trading, noto che SymbolInfoTick è in esecuzione per alcuni millisecondi. So al 100% che la CPU era completamente inattiva in quel momento.

È molto semplice. In un giorno ci sono condizionatamente 1 milione di zecche. Anche un ritardo dello 0,01% è di 100 tick al giorno con ritardi. Direte che è una sciocchezza. Dirò che è brutto. Se mi imbatto in un ritardo quando devo fare un ordine, è una potenziale perdita monetaria.

Molto grato che questo ramo non passi inosservato, e su questa caratteristica in particolare, è stato fatto un sacco di lavoro per accelerare le cose. Tuttavia, è stata un po' una sorpresa per me che la stampella terribile potesse superare la funzione regolare in certe situazioni. E forse, se lo risolvesse ed eliminasse quel ritardo, 100 potenziali ritardi al giorno diventerebbero 10.

Io dico che è molto meglio che all'inizio del thread. Ma resta il fatto che ci sono momenti in cui non va bene. E vedo che non vuoi indagare. Rispetto la vostra scelta.

Sopra ha citato l'opzione istantanea per ottenere i prezzi attuali. Mi andrebbe benissimo se non beccasse ritardi di millisecondi sulla macchina Idle-CPU.

Sono anche preoccupato non solo per la velocità di SymbolInfoTick, ma anche per la rilevanza dei prezzi che restituisce. Vedo che non sollevate questa questione. A quanto pare hai deciso di guardarlo dopo.

Queste non sono affatto condizioni calde. Un ciclo per 100000 richieste di prezzo senza Sleep() e simili e in 20 threads simultaneamente è un ovvio stress test. Niente del genere dovrebbe essere anche solo vicino in condizioni reali.

Se pensi che non ci siano altri tic in arrivo in 1,5 secondi - ok, fai 10 milioni di query, non cambierà nulla, la tua "stampella" funziona peggio:
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

L'affermazione che stai facendo è falsa al 100%:

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

Proprio come questa tua precedente affermazione:

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

L'accesso ai prezzi tramite SymbolInfoTick è ora molto veloce ed è completamente disaccoppiato dall'elaborazione del flusso di tick. Stai lavorando con una cache dei prezzi già pronta, che viene aggiornata con molta parsimonia e rapidamente.

Tutti i "rallentamenti dello 0,01% di tick rate" si manifestano solo in condizioni di stress test, e questo è un ottimo risultato. In condizioni normali, l'accesso è garantito per essere molto veloce.

Se ammetti che "è stato fatto molto lavoro per velocizzare" SymbolInfoTick, allora dovresti credermi che la "stampella" di ottenere i prezzi tramite PositionSelectByTicket non può essere una soluzione migliore.

Per una semplice ragione - l'implementazione di PositionSelectByTicket è completamente identica all'implementazione originale "lenta" di SymbolInfoTick.

Come ho scritto sopra, questa implementazione non è lenta nel senso letterale della parola, ma sotto un forte carico di CPU, ha una maggiore probabilità di outlier runtime (che è chiaramente visibile nel mio ultimo test).

I tempi qui sono altamente dipendenti dal task scheduler di sistema che gira sotto carico, cioè ci possono essere differenze da un sistema operativo all'altro e anche da una versione all'altra.

E più il carico è pesante, più si testano le prestazioni del task scheduler, non del terminale.

Questa è la fine dell'argomento sulle prestazioni di SymbolInfoTick.

Se i vostri esperti creano un carico a livello di stress test sintetico, c'è solo una soluzione: "l'hardware deve corrispondere ai compiti".

 

Ho una domanda sulla rilevanza dei tick dati da SymbolInfoTick.

Situazione:

1. Facciamo TimeCurretn(); otteniamo il tempo 18:00:00

2. Eseguire SymbolInfoTick su un simbolo non valido. Abbiamo un segno di spunta con il tempo 17:58:00.

3. Dormire(1)

4. Aggiunge un SymbolInfoTick per il simbolo non a sinistra. Otteniamo un segno di spunta con l'ora 17:59:00.


Cioè, nel quarto elemento abbiamo un nuovo tick, che è un minuto diverso da TimeCurretn().

Vede un problema in questa situazione?

Come fare per trovarsi meno spesso in questa situazione?

 
pivomoe:

Ho una domanda sulla rilevanza dei tick dati da SymbolInfoTick.

Situazione:

1. Facciamo TimeCurretn(); otteniamo il tempo 18:00:00

2. Eseguire SymbolInfoTick su un simbolo senza etichetta. Abbiamo un segno di spunta con il tempo 17:58:00.

3. Dormire(1)

4. Aggiunge un SymbolInfoTick per il simbolo non a sinistra. Otteniamo un segno di spunta con l'ora 17:59:00.


Cioè, nel quarto elemento abbiamo un nuovo tick, che è un minuto diverso da TimeCurretn().

Vede un problema in questa situazione?

Come trovarsi meno spesso in questa situazione?

SymbolInfoTick invia i dati ricevuti dal server del broker. Ciò che il server ha inviato è ciò che si ottiene.

Se ci sono domande sul flusso di tick che viene trasmesso dal tuo broker, allora devi contattare il tuo broker.