I will give you some information about the environment:
- Indicators 16, rendering is not complicated, without kanvas, toolbars, and other frills - sticks/stripes - a screenshot is attached.
- No programs on the chart, I open window after optimizer, it's just as an example - work charts slow down too, but less (there are less indicators).
- No, events are not processed.
- Unlimited bar display mode is selected, i.e. paging is sort of excluded.
- There are no graphical objects, or rather I have removed all arrows and dashes. There is one label left - it is from the indicator. I have a day off today and it should not interfere with it.
I have a screenshot above showing that graphics card is not working, can I check if it is working or is it normal when load is near zero and the core is busy?
Here it is a known problem on its face, the operation of the indicators in one thread! One thread cannot handle the load! We need multi-threading, it has been written about it many times before.
It turned out to be simpler, I saved the template after optimisation, opened a new chart and loaded the template - no brakes, which means the brakes are exactly when the chart is called from the optimiser!
Didn't notice that H1 was opened by default and brakes on M1. Built-in indicators still work well, but some of mine are slow when rendered.
I have found an indicator that even in 1 instance can load the processor (just scroll back and forth on the chart with the mouse wheel) - if you want a detailed analysis - I can send it to you in person.
1) you need to truncate the sturgeon with INT_MAX(2 bn) here:
this, too, we can correct
2) all memory must be managed in the most rigid way, no GC here
3) indicator reinitialization on timeframe change is warm without physical reinitialization from scratch, so you need to free memory by yourself. especially resources on global level
4) use OOP, it will at least give the possibility to properly describe and control the resources
Got it, thanks. Indeed, without INT_MAX the crash could not be reproduced. I never would have thought of that. I'll be more careful using extreme values from now on. I used them a lot. Sometimes you want to be a fool in the code to reproduce and check the foolproof protection.
the difference in performance between MQ5 and MQL4 is fantastic, but I would like to finish multiplatform code, so I have a question:
1. Which profiler(MQ5 or MQL4) is better to use to evaluate the optimization after making changes in a source code?
2. Does it make sense to turn all Print() calls into if( MQLInfoInteger(MQL_OPTIMIZATION)) check or Print() calls will be automatically excluded with no performance loss?
2019.09.1420:24:18.638 Core 2 genetic pass (2, 504) tested with error "no memory in OnTick function (cannot get 5376 Kb, used 1943 Mb)"in0:00:21.5362019.09.1420:24:33.884 Core 1 genetic pass (2, 432) tested with error "no memory in OnTick function (cannot get 5088 Kb, used 2130 Mb)"in0:00:26.0182019.09.1420:24:40.079 Core 2 genetic pass (2, 504) tested with error "no memory in OnTick function (cannot get 5376 Kb, used 1943 Mb)"in0:00:21.4392019.09.1420:25:00.011 Core 1 genetic pass (2, 432) tested with error "no memory in OnTick function (cannot get 5088 Kb, used 2130 Mb)"in0:00:26.1252019.09.1420:25:00.024 Core 1 genetic pass (2, 432) tested with error "no memory"in0:00:00.0002019.09.1420:25:00.037 Core 1 genetic pass (2, 432) tested with error "no memory"in0:00:00.0002019.09.1420:25:01.671 Core 2 genetic pass (2, 504) tested with error "no memory in OnTick function (cannot get 5376 Kb, used 1943 Mb)"in0:00:21.5892019.09.1420:25:01.680 Core 1 genetic pass (2, 504) tested with error "no memory"in0:00:00.0002019.09.1420:25:01.693 Core 1 genetic pass (2, 504) tested with error "no memory"in0:00:00.0002019.09.1420:25:10.181 Core 3 genetic pass (2, 432) tested with error "no memory in OnTick function (cannot get 5088 Kb, used 1659 Mb)"in0:00:10.1422019.09.1420:25:10.190 Core 1 genetic pass (2, 432) tested with error "no memory"in0:00:00.0002019.09.1420:25:10.203 Core 1 genetic pass (2, 432) tested with error "no memory"in0:00:00.0002019.09.1420:25:10.215 Core 1 genetic pass (2, 432) tested with error "no memory"in0:00:00.0002019.09.1420:25:10.228 Core 1 genetic pass (2, 432) tested with error "no memory"in0:00:00.0002019.09.1420:25:20.343 Core 3 genetic pass (2, 432) tested with error "no memory in OnTick function (cannot get 5088 Kb, used 1659 Mb)"in0:00:10.114
At first, all cores were running for about an hour with no errors. There are no arrays in the EA. Then such errors started to occur.
I have only one terminal running on my computer. 16Gb, 7 cores involved.
SZY The Expert Advisor differs from the others in that it has a larger number of trades
How much does trade history eat up then?
ZZZY Occasionally "no disk space" pops up, although tens of gigabytes are free.
Question for the back of my mind: how to put the source into kodobase together with graphic resources in bmp format (which go in OBJ_BITMAP_LABEL, for example)? Thestandard library only has bmp files in the res folder (i.e. I'm not aware that resources can be png/jpg). If attached in zip, the code won't compile when checked, will it?
Stanislav Korotky: Question for the back of my mind: how to put the source into kodobase together with graphic resources in bmp format (which go in OBJ_BITMAP_LABEL, for example)? The standard library only has bmp files in the res folder (i.e. I'm not aware that resources can be png/jpg). If attached in zip, the code won't compile when checked, will it?
Часто при создании программы, нам требуется использовать звуки и изображения. В языке MQL есть несколько возможностей использования таких данных, и все они связаны с необходимостью загружать файлы из файловой песочницы терминала. Если в конечном результате предполагается скомпилированный файл, то достаточно подключить файл как ресурс и...
I will give you some information about the environment:
- Indicators 16, rendering is not complicated, without kanvas, toolbars, and other frills - sticks/stripes - a screenshot is attached.
- No programs on the chart, I open window after optimizer, it's just as an example - work charts slow down too, but less (there are less indicators).
- No, events are not processed.
- Unlimited bar display mode is selected, i.e. paging is sort of excluded.
- There are no graphical objects, or rather I have removed all arrows and dashes. There is one label left - it is from the indicator. I have a day off today and it should not interfere with it.
I have a screenshot above showing that graphics card is not working, can I check if it is working or is it normal when load is near zero and the core is busy?
Here it is a known problem on its face, the operation of the indicators in one thread!
One thread cannot handle the load!
We need multi-threading, it has been written about it many times before.
It turned out to be simpler, I saved the template after optimisation, opened a new chart and loaded the template - no brakes, which means the brakes are exactly when the chart is called from the optimiser!
Didn't notice that H1 was opened by default and brakes on M1. Built-in indicators still work well, but some of mine are slow when rendered.
I have found an indicator that even in 1 instance can load the processor (just scroll back and forth on the chart with the mouse wheel) - if you want a detailed analysis - I can send it to you in person.1) you need to truncate the sturgeon with INT_MAX(2 bn) here:
this, too, we can correct
2) all memory must be managed in the most rigid way, no GC here
3) indicator reinitialization on timeframe change is warm without physical reinitialization from scratch, so you need to free memory by yourself. especially resources on global level
4) use OOP, it will at least give the possibility to properly describe and control the resources
Got it, thanks.
Indeed, without INT_MAX the crash could not be reproduced. I never would have thought of that. I'll be more careful using extreme values from now on. I used them a lot.
Sometimes you want to be a fool in the code to reproduce and check the foolproof protection.
the difference in performance between MQ5 and MQL4 is fantastic, but I would like to finish multiplatform code, so I have a question:
1. Which profiler(MQ5 or MQL4) is better to use to evaluate the optimization after making changes in a source code?
2. Does it make sense to turn all Print() calls into if( MQLInfoInteger(MQL_OPTIMIZATION)) check or Print() calls will be automatically excluded with no performance loss?
Optimiser
At first, all cores were running for about an hour with no errors. There are no arrays in the EA. Then such errors started to occur.
I have only one terminal running on my computer. 16Gb, 7 cores involved.
SZY The Expert Advisor differs from the others in that it has a larger number of trades
How much does trade history eat up then?
ZZZY Occasionally "no disk space" pops up, although tens of gigabytes are free.
Question for the back of my mind: how to put the source into kodobase together with graphic resources in bmp format (which go in OBJ_BITMAP_LABEL, for example)? The standard library only has bmp files in the res folder (i.e. I'm not aware that resources can be png/jpg). If attached in zip, the code won't compile when checked, will it?
Is this somehow supposed to answer the question about codobase?