
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
For information:
The first thing to understand is WHY? And what's the use of it?
You don't want to make links, we will do it ourselves.
Yes, it's hilarious ) . But really, I didn't even think it could be published in the help.
Can you tell me about all the flags already then?
For information:
I'm not afraid, I'm well aware that it's inexpensive. It's just inconvenient.
Please elaborate on this point - can there be memory reallocation during OnCalculate? This is bullshit.
About between calls, of course, it is clear.
I don't want to have a feature that binds an indicator or terminal in general, so I will use the safest variant available.
More on this point please - can there be memory reallocation during OnCalculate? That's just crazy.
More on this point please - can there be memory reallocation during OnCalculate? That's a bummer.
About between calls, of course, it's understandable.
Of course we are talking about possible redistribution between calls.
The problem is that someone will save reference between calls by mistake or explicitly, in 99% of cases everything will work until crash. After that there will be quite expected thoughts "it's Metakvots fault".
For example, we have had such thoughts broadcast by one comrade and have continued to do so for several years now, unable to accept that the history between calls can get swapped/changed.
Of course, we are talking about possible redistribution between calls.
The problem is that someone is bound to save the link between calls by mistake or explicitly, in 99% of cases everything will work until the crash. After which there will be the expected "It's Metakwots fault" thoughts.
"To fear guilt is not to walk forward" (c).
And one more thing: It is better to regret the done, than the not done.
Renat, let's say I agree that reference variables are a potential source of problems, but this can be said about almost any tool. Sometimes people poke other people with screwdrivers. There is no point in banning screwdrivers now, and it is even more senseless to simply remove them from production, because they can be made at home without too many problems.
"References" as an mql entity is highly desirable, not even in the form of variables, but as a possibility to return a reference ( lvalue ) from function. This will allow to make at least really fast left indexers for containers and give many other additional features, like:
And I understand that people will want to return a reference to a local variable from a function!
So, what? Forget about references, because they can make life harder for fools?)
--
Such limitations of mql5 (like lack of links) sometimes strongly motivate "escape to DLL", turning MT5 just into a "market driver" providing connection with broker. But the original idea was just the opposite - to eliminate the need to use external programming tools, because"everything is right here".
There is no turning back as we aim for maximum language security.
Working with raw links is a solid and sure step towards a crash. And crashing programs with the entire virtualisation system taken out is not allowed.
Our decision is fully informed. MQL5 is used to write programs that will run on a huge number of computers, and without human involvement.
Anyway, I hope the principle is clear to anyone who needs it. I will keep it for now, just to keep it to myself. But she will be, and will be open.
I don't need to explain that references to basic types, like int, are much easier to make without too many problems.
The only issue that causes complexity and implementation issues is the scope of the underlying variable. There's really a wide range of possibilities.
________
Well, and for motivation it is worth noting that links open a whole layer of additional possibilities, like wrappers for example.
lvalue links are planned...
Greetings all.
I wonder if anything has changed in eight years ?
Or, is it still possible to get an array address from OnCalculate() only using msvcrt.dll and memcpy function?
Or is everyone still "dragging" references to arrays through the entire class structure (alternatively, organizing their own arrays and copying the contents every time) ?