Errors, bugs, questions - page 1124
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
Although both structures are the same size and copy into each other without loss, we still get a warning.
So that's great. It's not that hard to make an obvious caste. And figuring out where to assign what when bugs start to creep in isn't very pleasant.
Copy from application to SR:
Terminal version and bit
910 32 bit
Problem description
Hello, dear developers!
In MQL5 a number of system functions such asCopyRates,CopyTime,CopyOpen, etc. are intended to receive time series data.
When you call any of these functions, the requested timeseries is loaded to RAM within the "Max bars in chart" parameter.
However, the combination of factors such as:
1. Sufficiently deep history available on the symbol or fully loaded from the server.
2. Max bars in chart" parameter is "Unlimited".
3. Data of the smallest timeframe M1 is requested.
A very large amount of memory is being consumed.
The problem is exacerbated by the fact that the logic of the program running MQL5 (for example, if it is a multicurrency Expert Advisor or an indicator)
may be laid down for alternate access to data of low-level timeframes of several symbols (for example, single search).
As a result, RAM consumption increases many times over.
Получение данных нужного таймфрейма из промежуточных данных
Service files in the HCC format play the role of the data source for building the price data by the requested timeframes in the HC format. The data in the HC format are timeseries that are maximally prepared for quick access. They are created only at requests of a chart or mql5-program in the volume not exceeding the "Max bars in charts" parameter, and are saved for further use in files with the hc extension.
To save resources, the data on the timeframe are loaded and stored in the RAM only when required.In case of long absence of requests the data are unloaded from the RAM saving them into a file. Data for each timeframe are prepared independently from the ready data for other timeframes. The rules for data preparation and availability are the same for all timeframes. I.e., despite the fact that the unit of data storing in the HCC format is the minute bar, the availability of the data in the HCC format does not mean the availability and accessibility of the HC format data for the M1 timeframe in the same volume.
Receipt of new data from the server causes automatic updating of used price data in HC format for all timeframes and recalculation of all indicators, which explicitly use them as input data for calculation.
The timing of the process highlighted in yellow on the cited quote from the documentation is quite large: about half an hour (from my observations).
As a result, all the requested timeseries are "sitting" in "RAM" for no reason at all.
If the "RAM" is not "rubber And the "voracious" Expert Advisor/indicator demands more and more timeseries, the terminal has nothing else to do
except for an urgent "dumping" of excess timeseries back to the file (cache). So, in this emergency reset, the terminal may reset the timeseries to
a "broken cache", i.e. it will lose "a good half" of the data. And the next time this timeseries is accessed, the terminal loads this "broken cache" as a normal one.
As a result, the terminal chart displays the needed timeseries with a huge hole in the history.
Expected result
The MQL5 language tends to save resources of the execution environment. An example of this is as follows:
1. theArrayFree function
2.resourceFree function
3.delete operator
4. Max bars in charts" parameter
Is it possible to add a system function to the MQL5 language functionality that would force the terminal to perform operations with the timeseries no longer being used?
If there is no opened chart with this time series, at the end of the timing?
For example, a function:
bool SeriesFlush(
string symbol_name, // имя символа
ENUM_TIMEFRAMES timeframe, // период
);
This would allow:
1. not worry about RAM overflow.
2. do not worry about "broken caches" that you can get rid of only by manually deleting *.hc files when the terminal is switched off.
3. You don't have to depend on the bit mode of your operating system and the size of RAM.
4. When developing a software product, do not use "crutches" that try to bypass the disadvantages described above.
Copy from application to SR:
Can you tell me how to get indicator data with a positive offset? I am interested in data on -1 bar?
To do this you need to know the offset settings for the indicator line of interest. This is an example from theiAlligator technical indicator
This is an offset, not an indicator calculation for the future.
Copy from application to SD:
Terminal version and bit mode
910 32 bit
Problem description
Hello, dear developers!
One of the recommendations to improve code quality when designing loops with a large number of iterations
is to embed verification of a forced stop of an MQL5 program using the system
IsStopped() system function;
However, in practice, this check doesn't work in indicators (it does in scripts and Expert Advisors)
Here is the indicator short code that shows the essence of the problem:
If you try to remove this indicator from the chart, the process of "calculating the indicator" will not stop as such,
though it should, because of the check of the stop flag of the program.
You can easily find this out by monitoring the terminal.exe process in Task Manager. On a quad core processor
it's about 25% of CPU load. Also, terminal load doesn't decrease at all over time until the
terminal shutdown. And even after terminal shutdown terminal.exe process still hangs in manager. And, it feels like,
that it is unloaded by the operating system as "hanging".
Expected result
Please, fix this problem.
To do this you need to know the offset settings for the indicator line of interest. This is an example from theiAlligator technical indicator
This is an offset, not the calculation of the indicator for the future.
I have a future calculation, but I use an offset to render it, how do I calculate -1 bar from the Expert Advisor?
If someone needs it, use CopyBuffer(Handle_original,0,-2,10,Data_Ind )
Exactly, I have a calculation in the future, but to draw an offset, how do I read -1 bar from the Expert Advisor?