Errors, bugs, questions - page 1733
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
Reference for arrays is a crutch in MQL language, not a reference.
And if [] is a type modifier like *, it should have its own const! and not a reference.
The error is justified - these identifiers are listed as ReadOnly in the help (not combined with ChartSetInteger)https://www.mql5.com/ru/docs/constants/chartconstants/enum_chart_property
would it help ?
Read it very carefully. C++ is much harder to understand than MQL. I don't understand much from the article. And I don't understand at all how it relates to what's being discussed here.
However, I liked the feature,
perfectforwarding
Before describing what it is, let's return to the previous standard and describe the existing problem. Suppose we have a template function foo taking one parameter and passing it to the function bar(T& something):
void foo(T& Object)
{
bar(Object);
}
So, everything is fine. But what if we want to pass, say, number 100 as an argument to a function?
Don't worry, we'll write it this way:
void foo(const T& Object)
{
bar(Object);//Ooops
}
But in this case there will be a compilation error because bar takes a non-constant reference. So, we have to provide 2 functions bar - constant and nonconstant. And now let's imagine that there is not only one parameter but 2, 3 or 5. It turns out that this task is very difficult to be implemented, as we have (2^n - 1) overloaded functions where n is the number of function arguments. If you think that such a number of parameters is bad style and no one writes this way at all, then look at std::bind, std::make_shared etc.
Now let's see what solution the new standard provides us with:
void foo(T&& Object)
{
bar(std::forward<T>(Object));
}
Using the above code, the parameter passing problem is completely solved, this is called perfect passing, because the argument type is preserved between calls to the external function foo and the internal function bar. There is no more need to overload a bunch of functions - generic code developers can be satisfied.
This solution is possible because if the template parameter is T&, the passed type will save itself, and std::forward is needed because any named type inside foo function turns into a lvalue and we need the original type - this is what std::forward is for - it saves the original type and strips the argument of its name (resulting in T&&), which allows it to be passed to the exact bar function later.
1455 - debugging on historical data (CTRL+F5) does not work. Tester window appears, visualisation does not start.
Read it very carefully. C++ is much harder to understand than MQL. I don't understand much from the article. And I don't understand at all how it relates to what's being discussed here.
However, I liked this feature,
I've encountered "(2^n - 1) overloaded functions, where n is the number of function arguments" - this is an inconvenience in MQL.It's about understanding rvalue / lvalue / prvalue / xvalue / gvalue, i.e. what you were basically talking about for several pages :) As I see, MQ followed C++ standards, taking the most valuable things from there, in their opinion, without stopping only at rvalue / lvalue.
I'm still not fully aware of these concepts myself, although I understand them logically :)
By the way, memory manager in MT5 works incomprehensibly, if the program uses memory to the fullest. I haven't measured it on small sizes.
For example, I own 4 gigs of RAM, 2 cores, MT5 v1455 x64 on virtual machine.
I am loading memory with objects and in Task Manager I see that 1.5 Gbytes of memory are used per terminal and 1.5 Gbytes per virtual memory.MQL_MEMORY_USED shows 400 MB of usable memory. Before the start it was about 140 mb for the terminal and 150 mb for the virtual app.
I also noticed that as soon as the memory usage exceeds 400 mb, the memory manager may fail to free it completely, although objects are actually deleted. And behavior of the debugger is unpredictable - I get to deleting objects, wait for their complete removal and after that stop debugging (by STOP button in the debugger), it stops, MT5 manager hasn't allocated memory to the system, i.e. there is still 1.5 Gb hanging there for the terminal and 1.5 Gb for the virtual memory. МТ5 itself hasn't completed the debugging process, though ME shows that debugging is completed. If the object memory is less than 400 mb, everything is fine, except the memory is freed.
The memory is released only after removing the terminal task from the list of running tasks.
It does not. Also, there are no technical details or description of your actions. This is a specialized branch where you need to prepare and provide additional information before writing about an allegedly found bug.
The Service Desk developers have already memorised my configuration several times.
I take any standard Expert Advisor and press CTRL+F5 in the MetaEditor. The main window of the Strategy Tester will pop up with settings specified in the MetaEditor. But the visualization does not start.
The log
The Service Desk developers have already remembered my configuration several times.
You didn't even realise what I was talking about.
What did you do before you started debugging on the story? Did you configure MetaEditor (tab "Tools" - "Settings" - "Debugging")? Give a screenshot from MetaEditora (tab "Tools" - "Settings" - "Debugging"), what is written in the Tester in the tab "Log"? What is written in the Viewer in the "Log" tab?
The Service Desk developers have already memorised my configuration several times.
I take any standard Expert Advisor and press CTRL+F5 in the MetaEditor. The main window of the Strategy Tester will pop up with settings specified in the MetaEditor. The visualization does not start.