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);
}
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);
}
See if you can run the script, please.
My Log:
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: Error on creating duplicate object - GetLastError=0
0 19:51:01.443 test CHFJPY.e,H1: Time to search Object by name 1000 times is 15129 microseconds. ChartID=131498872250507535 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.463 test CHFJPY.e,H1: Time to search Object by name 1000 times is 20278 microseconds. ChartID=131500664876581320 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.479 test CHFJPY.e,H1: Time to search Object by name 1000 times is 15825 microseconds. ChartID=131502896347051608 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.529 test CHFJPY.e,H1: Time to search Object by name 1000 times is 50372 microseconds. ChartID=131502897682567227 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.541 test CHFJPY.e,H1: Time to search Object by name 1000 times is 11587 microseconds. ChartID=131505457001351910 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.554 test CHFJPY.e,H1: Time to search Object by name 1000 times is 13026 microseconds. ChartID=131505572251554422 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.567 test CHFJPY.e,H1: Time to search Object by name 1000 times is 12949 microseconds. ChartID=131505732457965009 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.587 test CHFJPY.e,H1: Time to search Object by name 1000 times is 20701 microseconds. 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.606 test CHFJPY.e,H1: Time to search Object by name 1000 times is 18558 microseconds. 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.619 test CHFJPY.e,H1: Time to search Object by name 1000 times is 13219 microseconds. ChartID=131507869928472695 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.632 test CHFJPY.e,H1: Time to search Object by name 1000 times is 12294 microseconds. ChartID=131507916092399918 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=4200
0 19:51:01.632 test CHFJPY.e,H1: Time to search Object by name 1000 times is 98 microseconds. ChartID=131508222052591588 found obj: 1000 not found obj: 0 CURRENT CHART
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
Yes, there is a compiler bug here, but execution goes no further than this place - invalid pointer.
Then the bug is also in the fact that for 32-bit versions (I have exactly such one) execution is without errors. invalid pointer - only if you augment the class with a member, e.g. int i
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
And only make sense as input parameters to functions/methods?
MT4 build 1090
Error re-creating object onCURRENT chart Error=4200
Error re-creating an object on a non-current chart Error=0
Check script:
Runs through all the charts in the terminal, creates an object with a repeated name and generates an error in the log.
It will also check the search speed of the created object on the chart.
See if you can run the script, please.
My Log:
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: Error on creating duplicate object - GetLastError=0
0 19:51:01.443 test CHFJPY.e,H1: Time to search Object by name 1000 times is 15129 microseconds. ChartID=131498872250507535 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.463 test CHFJPY.e,H1: Time to search Object by name 1000 times is 20278 microseconds. ChartID=131500664876581320 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.479 test CHFJPY.e,H1: Time to search Object by name 1000 times is 15825 microseconds. ChartID=131502896347051608 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.529 test CHFJPY.e,H1: Time to search Object by name 1000 times is 50372 microseconds. ChartID=131502897682567227 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.541 test CHFJPY.e,H1: Time to search Object by name 1000 times is 11587 microseconds. ChartID=131505457001351910 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.554 test CHFJPY.e,H1: Time to search Object by name 1000 times is 13026 microseconds. ChartID=131505572251554422 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.567 test CHFJPY.e,H1: Time to search Object by name 1000 times is 12949 microseconds. ChartID=131505732457965009 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.587 test CHFJPY.e,H1: Time to search Object by name 1000 times is 20701 microseconds. 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.606 test CHFJPY.e,H1: Time to search Object by name 1000 times is 18558 microseconds. 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.619 test CHFJPY.e,H1: Time to search Object by name 1000 times is 13219 microseconds. ChartID=131507869928472695 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=0
0 19:51:01.632 test CHFJPY.e,H1: Time to search Object by name 1000 times is 12294 microseconds. ChartID=131507916092399918 found obj: 1000 not found 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: Error on creating duplicate object - GetLastError=4200
0 19:51:01.632 test CHFJPY.e,H1: Time to search Object by name 1000 times is 98 microseconds. ChartID=131508222052591588 found obj: 1000 not found obj: 0 CURRENT CHART
My search speed differs 100-500 times...
What about you?
Check script:
Runs through all the charts in the terminal, creates an object with a repeated name and logs an error.
It will also check the search speed of the created object on the chart.
See if you can run the script, please.
My search speed varies by a factor of 100-500...
And you?
Senka take the ball
Looks like HE :)
Senka take the ball
Looks like HE :)
Didn't understand anything, but it's still fun.
Didn't understand anything, but it's still fun.
Bug.
No error 4200 when creating duplicate object on non-current chart (which does give on current one - [see "CURRENT CHART" in log]) ,
as well as found out that finding an object in the RECENT CHART takes up to 500 times longer than finding the current one.
а :) because it turns out I'm not the only one
Do I understand correctly that such arrays cannot be initialized sensibly?
And only make sense as input parameters to functions/methods?
One would think it's possible, but as you can see from the example - leads to hard to catch errors
Yes, there is a compiler bug here, but no execution goes beyond this point - invalid pointer.
So, in fact, initialisation is not possible.
Yes, there is a compiler bug here, but execution goes no further than this place - invalid pointer.
Then the bug is also in the fact that for 32-bit versions (I have exactly such one) execution is without errors. invalid pointer - only if you augment the class with a member, e.g. int i