
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Alexander Laur, i.e. as long as the script/advisor is running the memory is reserved and cannot be cleared - sad conclusion.
Is it possible for the script to run another script, then closing the script running should cause the memory to be cleared, or would that be considered as a complex processing environment?
Alexander Laur, i.e. as long as the script/advisor is running, the memory is reserved and cannot be cleaned - sad conclusion.
Is it possible to run another script, then closing the script running should result in memory clearing, or will it be regarded as a complex data processing environment?
I immediately suggested"open chart with Expert Advisor running", it can be done - ChartOpen + ChartApplyTemplate
The only question is whether the memory will be freed when closing it (deleting the Expert Advisor).
Check it.
I immediately suggested"open chart with Expert Advisor running", it can be done - ChartOpen + ChartApplyTemplate
The only question is whether the memory will be freed when closing it (deleting the Expert Advisor).
Check.
Additional question, does the choice of the real buffer type for the calculation within the indicator affect the size of the graphical buffer?
Type
Size in bytes
Minimum positive value
Maximum value
Accuracy of representation
Analog in C++
float
4
1.175494351e-38
3.402823466e+38
7 significant digits
float
double
8
2.2250738585072014e-308
1.7976931348623158e+308
15 significant digits
double
And a crazy idea, what if instead of a graphical buffer we use TextOut - just don't know how to read data from it...
Additional question, does the selection of the real buffer type for the calculation within the indicator affect the size of the graphical buffer?
By the term "graphical buffer" do you mean the graphical displaying of a regular indicator?
The question is whether it is possible to affect the size of memory allocated to the graphical buffer by one bar if you use float instead of double in the indicator code for calculations.
//---- buffers
double Vy[];
double bufDirSoft[];
extern int n=3;
extern int BarsN=100;
//----
int ExtCountedBars=0;
The question is whether it is possible to affect the size of memory allocated to the graphical buffer by one bar if you use float rather than double in the indicator code for calculations...
No. There is a magic function that will displace all the attempts:
This mechanism is built into the Terminal language itself. It's an interesting idea, though...
Also, how can you tell if the memory has run out, are there any functions?
What do you mean run out of memory? :-)
There's something here:
https://www.mql5.com/ru/docs/constants/environment_state/terminalstatus#enum_terminal_info_integer
In my opinion, the most effective way to manage the memory for the indicator resources is to minimize the "Max bars in history" parameter (Settings --> Charts). As far as I remember, the minimum for the parameter is 5k.
Also, how can I know if memory is out, are there any functions?
It is possible to retrieve information about the terminal
TERMINAL_MEMORY_TOTAL
Memory size, available to terminal (agent) process, in MB
int
TERMINAL_MEMORY_AVAILABLE
The size of available memory of the terminal (agent) process in MB
int
TERMINAL_MEMORY_USED
Memory size, used by terminal (agent), in MB
int