voidOnStart()
{
ResetLastError();
ObjectCreate(ChartID(),"SomeName",OBJ_ARROW,0,0,0);
ObjectCreate(ChartID(),"SomeName",OBJ_ARROW,0,0,0);
Print("Ошибка повторного создания объекта на ТЕКУЩЕМ чарте Error=",GetLastError());
ObjectDelete(ChartID(),"SomeName");
ResetLastError();
ObjectCreate(ChartFirst(),"SomeName",OBJ_ARROW,0,0,0);
ObjectCreate(ChartFirst(),"SomeName",OBJ_ARROW,0,0,0);
Print("Ошибка повторного создания объекта на ПЕРВОМ чарте Error=",GetLastError());
ObjectDelete(ChartFirst(),"SomeName");
ResetLastError();
ObjectCreate(ChartNext(ChartFirst()),"SomeName",OBJ_ARROW,0,0,0);
ObjectCreate(ChartNext(ChartFirst()),"SomeName",OBJ_ARROW,0,0,0);
Print("Ошибка повторного создания объекта на НЕ ТЕКУЩЕМ чарте Error=",GetLastError());
ObjectDelete(ChartNext(ChartFirst()),"SomeName");
ResetLastError();
ObjectCreate(0,"SomeName",OBJ_ARROW,0,0,0);
ObjectCreate(0,"SomeName",OBJ_ARROW,0,0,0);
Print("Ошибка повторного создания объекта на ТЕКУЩЕМ чарте Error=",GetLastError());
ObjectDelete(0,"SomeName");
ResetLastError();
Print("__MQL4BUILD__ = ",__MQL4BUILD__," TERMINAL_BUILD = ",TERMINAL_BUILD);
}
Erreur de recréation d'objet sur legraphique CURRENT Error=4200
Erreur de recréation d'un objet sur un graphique non courant Error=0
Exécute tous les graphiques dans le terminal, crée un objet avec un nom répété et génère une erreur dans le journal.
Il vérifiera également la vitesse de recherche de l'objet créé sur le graphique.
voidOnStart()
{
Print("__MQL4BUILD__ = ",__MQL4BUILD__," TERMINAL_BUILD = ",TERMINAL_BUILD);
ResetLastError();
//--- переменные для идентификаторов графиков long currChart,prevChart=ChartFirst();
int i=0,limit=100;
Print("ChartFirst = ",ChartSymbol(prevChart)," ID = ",prevChart);
//создадим дублирующий объект для графика и выведем ошибкуObjectCreate(prevChart,"SomeName",OBJ_ARROW,0,0,0);
ObjectCreate(prevChart,"SomeName",OBJ_ARROW,0,0,0);
Print(" Error on creating duplicate object - GetLastError=",GetLastError());
ObjectDelete(prevChart,"SomeName");
ObjectFindSearchBench(1000,prevChart);//SearchBenchwhile(i<limit)// у нас наверняка не больше 100 открытых графиков
{
currChart=ChartNext(prevChart); // на основании предыдущего получим новый график if(currChart<0) break; // достигли конца списка графиков Print(i," ",ChartSymbol(currChart)," ID =",currChart);
prevChart=currChart;// запомним идентификатор текущего графика для ChartNext() //создадим дублирующиеся объектыResetLastError();
ObjectCreate(prevChart,"SomeName",OBJ_ARROW,0,0,0);
ObjectCreate(prevChart,"SomeName",OBJ_ARROW,0,0,0);
Print(" Error on creating duplicate object - GetLastError=",GetLastError());
ObjectDelete(prevChart,"SomeName");
ObjectFindSearchBench(1000,prevChart);//SearchBench
i++;// не забудем увеличить счетчик
}
}
//+------------------------------------------------------------------+//| |//+------------------------------------------------------------------+ulong ObjectFindSearchBench(constint Amount=1 e3,long chart=0)
{
int b=0,f=0;
ResetLastError();
if(chart==0) chart=ChartID();
constulong StartTime=GetMicrosecondCount();
//создадим объект и потом найдем его Amount разObjectCreate(chart,"SomeName",OBJ_ARROW,0,0,0);
for(int w=0;w<Amount;w++)
{
if(ObjectFind(chart,"SomeName")>=0)
{
b++;
}
else f++;
}
Print("Time to search Object by name ",Amount," times is ",GetMicrosecondCount()-StartTime," microseconds. ChartID=",chart," found obj: ",b," not found obj: ",f,chart==ChartID()?" CURRENT CHART":"");
return(GetMicrosecondCount() - StartTime);
}
Voyez si vous pouvez exécuter le script, s'il vous plaît.
0 19:51:01.427 test CHFJPY.e,H1 : ChartFirst = EURCAD.e ID = 131498872250507535
0 19:51:01.427 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.443 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 15129 microsecondes. ChartID=131498872250507535 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.443 test CHFJPY.e,H1 : 0 EURCAD.e ID=131500664876581320
0 19:51:01.443 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.463 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 20278 microsecondes. ChartID=131500664876581320 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.463 test CHFJPY.e,H1 : 1 CADJPY.e ID=131502896347051608
0 19:51:01.463 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.479 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 15825 microsecondes. ChartID=131502896347051608 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.479 test CHFJPY.e,H1 : 2 EURCAD.e ID=131502897682567227
0 19:51:01.479 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.529 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 50372 microsecondes. ChartID=131502897682567227 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.529 test CHFJPY.e,H1 : 3 GBPJPY.e ID=131505457001351910
0 19:51:01.529 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.541 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 11587 microsecondes. ChartID=131505457001351910 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.541 test CHFJPY.e,H1 : 4 GBPCHF.e ID=131505572251554422
0 19:51:01.541 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.554 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 13026 microsecondes. ChartID=131505572251554422 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.554 test CHFJPY.e,H1 : 5 AUDCHF.e ID=131505732457965009
0 19:51:01.554 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.567 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 12949 microsecondes. ChartID=131505732457965009 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.567 test CHFJPY.e,H1 : 6 USDCHF.e ID=131506110968531490
0 19:51:01.567 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.587 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 20701 microsecondes. ChartID=131506110968531490 found obj : 1000 not found obj : 0
0 19:51:01.587 test CHFJPY.e,H1 : 7 AUDUSD.e ID=131507551330304303
0 19:51:01.587 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.606 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 18558 microsecondes. ChartID=131507551330304303 found obj : 1000 not found obj : 0
0 19:51:01.606 test CHFJPY.e,H1 : 8 EURCAD.e ID=131507869928472695
0 19:51:01.606 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.619 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 13219 microsecondes. ChartID=131507869928472695 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.619 test CHFJPY.e,H1 : 9 EURAUD.e ID=131507916092399918
0 19:51:01.619 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.632 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 12294 microsecondes. ChartID=131507916092399918 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.632 test CHFJPY.e,H1 : 10 CHFJPY.e ID=131508222052591588
0 19:51:01.632 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=4200
0 19:51:01.632 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 98 microsecondes. ChartID=131508222052591588 found obj : 1000 not found obj : 0 CURRENT CHART
Ma vitesse de recherche diffère de 100 à 500 fois...
Exécute tous les graphiques dans le terminal, crée un objet avec un nom répété et enregistre une erreur.
Il vérifiera également la vitesse de recherche de l'objet créé sur le graphique.
Voyez si vous pouvez exécuter le script, s'il vous plaît.
Ma vitesse de recherche varie d'un facteur de 100 à 500...
Et vous ?
019:59:35.973 PeriodConverter GBPUSDf,M15: __MQL4BUILD__ = 553TERMINAL_BUILD = 5019:59:35.973 PeriodConverter GBPUSDf,M15: ChartFirst = AUDUSDf ID = 130936784496551158019:59:35.973 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0019:59:36.013 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 32430 microseconds. ChartID=130936784496551158 found obj: 1000 not found obj: 0019:59:36.013 PeriodConverter GBPUSDf,M15: 0 USDCADf ID =130936784496551160019:59:36.013 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0019:59:36.023 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 11738 microseconds. ChartID=130936784496551160 found obj: 1000 not found obj: 0019:59:36.023 PeriodConverter GBPUSDf,M15: 1 GBPAUDf ID =130936784496551163019:59:36.023 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0019:59:36.033 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 7645 microseconds. ChartID=130936784496551163 found obj: 1000 not found obj: 0019:59:36.033 PeriodConverter GBPUSDf,M15: 2 EURUSDf ID =130936784496551164019:59:36.033 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0019:59:36.043 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 8734 microseconds. ChartID=130936784496551164 found obj: 1000 not found obj: 0019:59:36.043 PeriodConverter GBPUSDf,M15: 3 EURJPYf ID =130936784496551165019:59:36.043 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0019:59:36.053 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 12249 microseconds. ChartID=130936784496551165 found obj: 1000 not found obj: 0019:59:36.053 PeriodConverter GBPUSDf,M15: 4 EURCADf ID =130936784496551166019:59:36.053 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0019:59:36.063 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 15107 microseconds. ChartID=130936784496551166 found obj: 1000 not found obj: 0019:59:36.063 PeriodConverter GBPUSDf,M15: 5 USDCHFf ID =130936784496551167019:59:36.063 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0019:59:36.093 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 31361 microseconds. ChartID=130936784496551167 found obj: 1000 not found obj: 0019:59:36.093 PeriodConverter GBPUSDf,M15: 6 GBPUSDf ID =130936784496551169019:59:36.093 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=4200019:59:36.093 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 156 microseconds. ChartID=130936784496551169 found obj: 1000 not found obj: 0 CURRENT CHART
019:59:36.093 PeriodConverter GBPUSDf,M15: 7 AUDCADf ID =130936784496551170019:59:36.093 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0019:59:36.103 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 10455 microseconds. ChartID=130936784496551170 found obj: 1000 not found obj: 0019:59:36.103 PeriodConverter GBPUSDf,M15: 8 CADCHFf ID =130936784496551171019:59:36.103 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0019:59:36.133 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 28968 microseconds. ChartID=130936784496551171 found obj: 1000 not found obj: 0019:59:36.133 PeriodConverter GBPUSDf,M15: 9 NZDCADf ID =130936784496551175019:59:36.133 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0019:59:36.153 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 18735 microseconds. ChartID=130936784496551175 found obj: 1000 not found obj: 0019:59:36.153 PeriodConverter GBPUSDf,M15: 10 NZDCHFf ID =130936784496551176019:59:36.153 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0019:59:36.163 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 10593 microseconds. ChartID=130936784496551176 found obj: 1000 not found obj: 0019:59:36.163 PeriodConverter GBPUSDf,M15: 11 NZDUSDf ID =130936784496551178019:59:36.163 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0019:59:36.193 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 23403 microseconds. ChartID=130936784496551178 found obj: 1000 not found obj: 0019:59:36.193 PeriodConverter GBPUSDf,M15: 12 EURNZDf ID =130936912624549660019:59:36.193 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0019:59:36.213 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 19404 microseconds. ChartID=130936912624549660 found obj: 1000 not found obj: 0019:59:36.213 PeriodConverter GBPUSDf,M15: 13 EURAUDf ID =130936912624549662019:59:36.213 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0019:59:36.213 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 7570 microseconds. ChartID=130936912624549662 found obj: 1000 not found obj: 0019:59:36.213 PeriodConverter GBPUSDf,M15: uninit reason 0019:59:36.223 Script PeriodConverter GBPUSDf,M15: removed
020:00:18.966 Script PeriodConverter GBPUSDf,M15: loaded successfully
020:00:18.986 PeriodConverter GBPUSDf,M15: initialized
020:00:18.986 PeriodConverter GBPUSDf,M15: __MQL4BUILD__ = 553TERMINAL_BUILD = 5020:00:18.986 PeriodConverter GBPUSDf,M15: ChartFirst = AUDUSDf ID = 130936784496551158020:00:18.986 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0020:00:19.036 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 42453 microseconds. ChartID=130936784496551158 found obj: 1000 not found obj: 0020:00:19.036 PeriodConverter GBPUSDf,M15: 0 USDCADf ID =130936784496551160020:00:19.036 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0020:00:19.046 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 17436 microseconds. ChartID=130936784496551160 found obj: 1000 not found obj: 0020:00:19.046 PeriodConverter GBPUSDf,M15: 1 GBPAUDf ID =130936784496551163020:00:19.046 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0020:00:19.086 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 33961 microseconds. ChartID=130936784496551163 found obj: 1000 not found obj: 0020:00:19.086 PeriodConverter GBPUSDf,M15: 2 EURUSDf ID =130936784496551164020:00:19.086 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0020:00:19.096 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 8201 microseconds. ChartID=130936784496551164 found obj: 1000 not found obj: 0020:00:19.096 PeriodConverter GBPUSDf,M15: 3 EURJPYf ID =130936784496551165020:00:19.096 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0020:00:19.106 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 13671 microseconds. ChartID=130936784496551165 found obj: 1000 not found obj: 0020:00:19.106 PeriodConverter GBPUSDf,M15: 4 EURCADf ID =130936784496551166020:00:19.106 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0020:00:19.136 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 28041 microseconds. ChartID=130936784496551166 found obj: 1000 not found obj: 0020:00:19.136 PeriodConverter GBPUSDf,M15: 5 USDCHFf ID =130936784496551167020:00:19.136 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0020:00:19.146 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 12396 microseconds. ChartID=130936784496551167 found obj: 1000 not found obj: 0020:00:19.146 PeriodConverter GBPUSDf,M15: 6 GBPUSDf ID =130936784496551169020:00:19.146 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=4200020:00:19.146 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 159 microseconds. ChartID=130936784496551169 found obj: 1000 not found obj: 0 CURRENT CHART
020:00:19.146 PeriodConverter GBPUSDf,M15: 7 AUDCADf ID =130936784496551170020:00:19.146 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0020:00:19.236 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 91767 microseconds. ChartID=130936784496551170 found obj: 1000 not found obj: 0020:00:19.236 PeriodConverter GBPUSDf,M15: 8 CADCHFf ID =130936784496551171020:00:19.236 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0020:00:19.296 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 53496 microseconds. ChartID=130936784496551171 found obj: 1000 not found obj: 0020:00:19.296 PeriodConverter GBPUSDf,M15: 9 NZDCADf ID =130936784496551175020:00:19.296 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0020:00:19.378 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 80612 microseconds. ChartID=130936784496551175 found obj: 1000 not found obj: 0020:00:19.378 PeriodConverter GBPUSDf,M15: 10 NZDCHFf ID =130936784496551176020:00:19.378 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0020:00:19.418 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 42953 microseconds. ChartID=130936784496551176 found obj: 1000 not found obj: 0020:00:19.418 PeriodConverter GBPUSDf,M15: 11 NZDUSDf ID =130936784496551178020:00:19.418 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0020:00:19.438 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 19186 microseconds. ChartID=130936784496551178 found obj: 1000 not found obj: 0020:00:19.438 PeriodConverter GBPUSDf,M15: 12 EURNZDf ID =130936912624549660020:00:19.438 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0020:00:19.448 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 9539 microseconds. ChartID=130936912624549660 found obj: 1000 not found obj: 0020:00:19.448 PeriodConverter GBPUSDf,M15: 13 EURAUDf ID =130936912624549662020:00:19.448 PeriodConverter GBPUSDf,M15: Error on creating duplicate object - GetLastError=0020:00:19.498 PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 47959 microseconds. ChartID=130936912624549662 found obj: 1000 not found obj: 0
Je n'ai rien compris, mais c'est quand même amusant.
Bug.
Pas d'erreur 4200 lors de la création d'un objet dupliqué sur un graphique NON ACTUEL (qui donne le graphique actuel - [voir "CURRENT CHART" dans le journal]),
Nous avons également découvert que trouver un objet dans le tableau RECENT prend jusqu'à 500 fois plus de temps que de trouver l'objet actuel.
а :) parce qu'il s'avère que je ne suis pas le seul
Oui, il y a un bug du compilateur ici, mais l'exécution ne va pas plus loin que cet endroit - pointeur invalide.
Alors le bug est aussi dans le fait que pour les versions 32 bits (j'ai exactement une telle version) l'exécution est sans erreurs. pointeur invalide - seulement si vous augmentez la classe avec un membre, par exemple int i
Un autre bug est que la version 32 bits (la mienne est exacte) n'a pas d'erreurs d'exécution. pointeur invalide - seulement si la classe est augmentée d'un membre, par exemple int i
Vous devez avoir testé sur MT4, mais la construction est plus faible là aussi.
Si vous n'avez pas de compte, veuillez vous inscrire
Autorisez l'utilisation de cookies pour vous connecter au site Web MQL5.com.
Veuillez activer les paramètres nécessaires dans votre navigateur, sinon vous ne pourrez pas vous connecter.
Vous êtes connecté. L'authentification à deux facteurs a été désactivée. Configurez-la à nouveau et scannez un nouveau code QR, ou continuez avec l'authentification à deux facteurs désactivée.
MT4 build 1090
Erreur de recréation d' objet sur legraphique CURRENT Error=4200
Erreur de recréation d'un objet sur un graphique non courant Error=0
Vérifiez le script :
Exécute tous les graphiques dans le terminal, crée un objet avec un nom répété et génère une erreur dans le journal.
Il vérifiera également la vitesse de recherche de l'objet créé sur le graphique.
Voyez si vous pouvez exécuter le script, s'il vous plaît.
Mon journal :
0 19:51:01.427 test CHFJPY.e,H1 : __MQL4BUILD__ = 553 TERMINAL_BUILD = 5
0 19:51:01.427 test CHFJPY.e,H1 : ChartFirst = EURCAD.e ID = 131498872250507535
0 19:51:01.427 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.443 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 15129 microsecondes. ChartID=131498872250507535 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.443 test CHFJPY.e,H1 : 0 EURCAD.e ID=131500664876581320
0 19:51:01.443 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.463 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 20278 microsecondes. ChartID=131500664876581320 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.463 test CHFJPY.e,H1 : 1 CADJPY.e ID=131502896347051608
0 19:51:01.463 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.479 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 15825 microsecondes. ChartID=131502896347051608 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.479 test CHFJPY.e,H1 : 2 EURCAD.e ID=131502897682567227
0 19:51:01.479 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.529 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 50372 microsecondes. ChartID=131502897682567227 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.529 test CHFJPY.e,H1 : 3 GBPJPY.e ID=131505457001351910
0 19:51:01.529 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.541 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 11587 microsecondes. ChartID=131505457001351910 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.541 test CHFJPY.e,H1 : 4 GBPCHF.e ID=131505572251554422
0 19:51:01.541 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.554 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 13026 microsecondes. ChartID=131505572251554422 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.554 test CHFJPY.e,H1 : 5 AUDCHF.e ID=131505732457965009
0 19:51:01.554 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.567 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 12949 microsecondes. ChartID=131505732457965009 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.567 test CHFJPY.e,H1 : 6 USDCHF.e ID=131506110968531490
0 19:51:01.567 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.587 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 20701 microsecondes. ChartID=131506110968531490 found obj : 1000 not found obj : 0
0 19:51:01.587 test CHFJPY.e,H1 : 7 AUDUSD.e ID=131507551330304303
0 19:51:01.587 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.606 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 18558 microsecondes. ChartID=131507551330304303 found obj : 1000 not found obj : 0
0 19:51:01.606 test CHFJPY.e,H1 : 8 EURCAD.e ID=131507869928472695
0 19:51:01.606 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.619 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 13219 microsecondes. ChartID=131507869928472695 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.619 test CHFJPY.e,H1 : 9 EURAUD.e ID=131507916092399918
0 19:51:01.619 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=0
0 19:51:01.632 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 12294 microsecondes. ChartID=131507916092399918 trouvé obj : 1000 non trouvé obj : 0
0 19:51:01.632 test CHFJPY.e,H1 : 10 CHFJPY.e ID=131508222052591588
0 19:51:01.632 test CHFJPY.e,H1 : Erreur lors de la création d'un objet dupliqué - GetLastError=4200
0 19:51:01.632 test CHFJPY.e,H1 : Le temps pour rechercher un objet par son nom 1000 fois est de 98 microsecondes. ChartID=131508222052591588 found obj : 1000 not found obj : 0 CURRENT CHART
Ma vitesse de recherche diffère de 100 à 500 fois...
Et vous ?
Vérifiez le script :
Exécute tous les graphiques dans le terminal, crée un objet avec un nom répété et enregistre une erreur.
Il vérifiera également la vitesse de recherche de l'objet créé sur le graphique.
Voyez si vous pouvez exécuter le script, s'il vous plaît.
Ma vitesse de recherche varie d'un facteur de 100 à 500...
Et vous ?
Senka prend la balle
On dirait HE :)
Senka prend la balle
On dirait HE :)
Je n'ai rien compris, mais c'est quand même amusant.
Je n'ai rien compris, mais c'est quand même amusant.
Bug.
Pas d'erreur 4200 lors de la création d'un objet dupliqué sur un graphique NON ACTUEL (qui donne le graphique actuel - [voir "CURRENT CHART" dans le journal]),
Nous avons également découvert que trouver un objet dans le tableau RECENT prend jusqu'à 500 fois plus de temps que de trouver l'objet actuel.
а :) parce qu'il s'avère que je ne suis pas le seul
Ai-je bien compris que de tels tableaux ne peuvent pas être initialisés de manière sensée ?
Et n'ont de sens que comme paramètres d'entrée des fonctions/méthodes ?
On pourrait penser que c'est possible, mais comme vous pouvez le voir dans l'exemple, cela conduit à des erreurs difficiles à détecter.
Oui, il y a un bug du compilateur ici, mais aucune exécution ne va au-delà de ce point - pointeur invalide.
Donc, en fait, aucune initialisation n'est possible.
Oui, il y a un bug du compilateur ici, mais l'exécution ne va pas plus loin que cet endroit - pointeur invalide.
Alors le bug est aussi dans le fait que pour les versions 32 bits (j'ai exactement une telle version) l'exécution est sans erreurs. pointeur invalide - seulement si vous augmentez la classe avec un membre, par exemple int i
Un autre bug est que la version 32 bits (la mienne est exacte) n'a pas d'erreurs d'exécution. pointeur invalide - seulement si la classe est augmentée d'un membre, par exemple int i
Vous devez avoir testé sur MT4, mais la construction est plus faible là aussi.