Un simple remplacement pour un commentaire. Fonctionne dans le testeur 50 fois plus vite que la fonction standard.
Il est connu que la fonction standard "Commentaire" ralentit considérablement le testeur.
Voici un exemple de code et son temps d'exécution dans le testeur.
void OnTick() { MqlTick tick; SymbolInfoTick(_Symbol, tick); if(tick.ask != 0 && tick.bid != 0) { string str = StringFormat("ask = %.5f\nbid = %.5f\ntime = %s", tick.ask, tick.bid, TimeToString(tick.time, TIME_DATE | TIME_SECONDS)); Comment(str); } } //+------------------------------------------------------------------+

11 minutes 28 secondes ! !!

Il suffit d'ajouter le code #include <Comm.mqh>
#include <Comm.mqh> //+------------------------------------------------------------------+ void OnTick() { MqlTick tick; SymbolInfoTick(_Symbol, tick); if(tick.ask != 0 && tick.bid != 0) { string str = StringFormat("ask = %.5f\nbid = %.5f\ntime = %s", tick.ask, tick.bid, TimeToString(tick.time, TIME_DATE | TIME_SECONDS)); Comment(str); } } //+------------------------------------------------------------------+

14 secondes ! !!

Exemple d'utilisation avec les paramètres par défaut.
Il n'est pas nécessaire de déclarer une instance de la classe.
#include <Comm.mqh> //+------------------------------------------------------------------+ void OnTick() { string str = "PROGRAM_NAME = " + MQLInfoString(MQL_PROGRAM_NAME) + "\n" + (string)TimeCurrent(); Comment(str); } //+------------------------------------------------------------------+

Exemple d'utilisation avec la possibilité de modifier les paramètres.
#include <Comm.mqh> //+------------------------------------------------------------------+ void OnTick() { string str = "PROGRAM_NAME = " + MQLInfoString(MQL_PROGRAM_NAME) + "\n" + (string)TimeCurrent(); Comment(str, _Xpx, _Ypx, _clrText, _FontSize, _clrBack, _Transparency, _Font, _corner); } //+------------------------------------------------------------------+

Exemple d'utilisation de plusieurs instances d'un commentaire.
#include <Comm.mqh> CComm comm1; CComm comm2; CComm comm3; CComm comm4; //+------------------------------------------------------------------+ void OnTick() { MqlTick tick; SymbolInfoTick(_Symbol, tick); if(tick.ask != 0 && tick.bid != 0) { string str = StringFormat("ask = %.5f\nbid = %.5f\ntime = %s", tick.ask, tick.bid, TimeToString(tick.time, TIME_DATE | TIME_SECONDS)); Comment(str); comm1.Comm(str, _Xpx, _Ypx + 80, _clrText, _FontSize, _clrBack, _Transparency, _Font, _corner); comm2.Comm(str, _Xpx + 10, _Ypx + 20, _clrText, _FontSize, clrGreen, _Transparency, _Font, CORNER_LEFT_LOWER); comm3.Comm(str, _Xpx + 30, _Ypx, clrGreen, _FontSize, _clrBack, _Transparency, _Font, CORNER_RIGHT_LOWER); comm4.Comm(str, _Xpx, _Ypx + 50, clrBlack, _FontSize, _clrBack, _Transparency, _Font, CORNER_RIGHT_UPPER); } } //+------------------------------------------------------------------+

mise à jour 05.12.2024 version 1.06
mise à jour 05.12.2024 version 1.07
Traduit de l’anglais par MetaQuotes Ltd.
Code original : /en/code/53499
ZigZag sur Parabolic
Cet indicateur trace une courbe en zigzag à partir des données fournies par l'indicateur technique Parabolic SAR.
Indice de la demande
L'indice de la demande (Demand Index) a été mis au point par James Sibbett. Ce calcul s'appuie sur les prix et les volumes. Cet indice est considéré comme un indicateur avancé.
Volume weighted line chart with smoothing
Un graphique linéaire plus lisse qui élimine une grande partie du bruit du marché et utilise le volume dans la formule.
SuperTrend
L'indicateur de tendance SuperTrend.