MT5 e la velocità in azione - pagina 90

 

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

MT5 e la velocità in azione

fxsaber, 2021.03.10 14:53

Un chiaro esempio di ciò che rallenta il Market Watch.

Guardate i valori nella colonna Processore (secondo da destra).


Forse Market Overview dovrebbe essere gestito dalla scheda video?

 
BillionerClub:

Forse la panoramica del mercato dovrebbe essere gestita dalla scheda video?

Specialmente se la MT è in una macchina virtuale (un caso non raro).

 
BillionerClub:

Forse la panoramica del mercato dovrebbe essere gestita dalla scheda video?

Non c'è un limite di FPS (Frames per Second) nel terminale. In Market Watch può essere 300 fps o superiore.

Qualsiasi visualizzazione nei terminali di trading a fps > 50 è uno spreco di risorse di calcolo.

 
BillionerClub:

Forse la panoramica del mercato dovrebbe essere gestita dalla scheda video?

piuttosto non essere basato su SysListView32, che non è veloce di per sé, ma avere un proprio elemento per il rendering, ma con tutto il "fascino" di implementare lo scorrimento, l'ordinamento, ecc. Un'altra domanda - è così necessario quando si lavora in questa forma? e poi spegnerlo per il periodo di lavoro sarebbe un'opzione per risolvere questo problema (se è un problema)

 
Trovata la cache delle proprietà mancanti per gli oggetti grafici.
#include <fxsaber\Benchmark\Benchmark.mqh> // https://www.mql5.com/ru/code/31279

void OnStart()
{
  const string Name = "ObjectName";
  
  ObjectCreate(0, Name, OBJ_BITMAP_LABEL, 0, 0, 0);
  
  for (int i = 0; i < 10; i++)
    _B(::ObjectGetInteger(0, Name, OBJPROP_COLOR), 100); // Повторное обращение к тому же объекту должно быть быстрым, но этого не происходит.
    
  ObjectDelete(0, Name);
  
  Print(::ObjectSetInteger(0, Name, OBJPROP_COLOR, 0)); // true для удаленного объекта!
}


Risultato.

Alert: Bench_Stack = 0, 100 <= Time[Test9.mq5 555 in OnStart: ::ObjectGetInteger(0,Name,OBJPROP_COLOR)] = 9361 mcs.
Alert: Bench_Stack = 0, 100 <= Time[Test9.mq5 555 in OnStart: ::ObjectGetInteger(0,Name,OBJPROP_COLOR)] = 396 mcs.
Alert: Bench_Stack = 0, 100 <= Time[Test9.mq5 555 in OnStart: ::ObjectGetInteger(0,Name,OBJPROP_COLOR)] = 1399 mcs.
Alert: Bench_Stack = 0, 100 <= Time[Test9.mq5 555 in OnStart: ::ObjectGetInteger(0,Name,OBJPROP_COLOR)] = 987 mcs.
Alert: Bench_Stack = 0, 100 <= Time[Test9.mq5 555 in OnStart: ::ObjectGetInteger(0,Name,OBJPROP_COLOR)] = 1111 mcs.
Alert: Bench_Stack = 0, 100 <= Time[Test9.mq5 555 in OnStart: ::ObjectGetInteger(0,Name,OBJPROP_COLOR)] = 1040 mcs.
Alert: Bench_Stack = 0, 100 <= Time[Test9.mq5 555 in OnStart: ::ObjectGetInteger(0,Name,OBJPROP_COLOR)] = 639 mcs.
Alert: Bench_Stack = 0, 100 <= Time[Test9.mq5 555 in OnStart: ::ObjectGetInteger(0,Name,OBJPROP_COLOR)] = 796 mcs.
true


Molto costoso, e anche un errore della funzione ObjectSet.

Stringa di ricerca: Oshibka 026.

 
fxsaber:

E anche un errore della funzione ObjectSet.

Stringa di ricerca: Oshibka 026.

Gestione degli oggetti asincrona

 
Andrey Khatimlianskii:

La gestione degli oggetti è asincrona

Si scopre che ObjectSet deve sempre restituire true.

 
fxsaber:

Si scopre che ObjectSet deve sempre restituire true.

Leggete l'aiuto:

https://www.mql5.com/ru/docs/objects/objectsetinteger

Valore restituito

Restituisce true solo se il comando per cambiare le proprietà dell'oggetto grafico è stato inviato con successo al grafico, altrimenti restituisce false. Per ottenere maggiori informazioni sull'errore, chiamare GetLastError().


Документация по MQL5: Графические объекты / ObjectSetInteger
Документация по MQL5: Графические объекты / ObjectSetInteger
  • www.mql5.com
ObjectSetInteger - Графические объекты - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
fxsaber:

Si scopre che ObjectSet deve sempre restituire true.

Non posso arrivare alla stessa conclusione usando la logica.

 
Andrey Khatimlianskii:

Anton:

false - solo se sbagliato con ChartID. Con il proprio ChartID (zero) è sempre vero.

Bisogna sforzarsi molto per provocare il falso.