Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1611
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
Why wait until tomorrow? If you're too lazy to look through the specs, run the script through all the symbols of interest and find a match for margin currency and profit currency.
I haven't checked everything before writing, but I didn't find any coincidence...
Bit busy today.
well, the point is quick - took the currency code, did a search on a ready array which is updated when a trade is opened.
Everything is hard to score in an array one time
It will live forever.
It will live forever.
As long as object U is alive? Or until the terminal is rebooted? Roughly speaking, after which it is deleted?
As long as the U object is alive?
No, the class instance may not even be created, but the class static field will be allocated memory and initialized.... By the way, your example, in my opinion, shouldn't compile, static field initialization should be outside of description
Whether until the terminal is overloaded? Roughly speaking, after which it is removed?
The terminal has nothing to do with it, the lifetime is the same as for the globally declared variables or for the regular static variables - the memory is allocated when you load the MQL-program and released when unloading the MQL-program
No, the class instance may not even be created, but the class static field will be allocated memory and initialized.... By the way, your example, in my opinion, shouldn't compile, initialization of static fields should be outside the description.
Ok! Seems to compile...
Igor Makanu #:
The terminal has nothing to do with it, the lifetime is the same as for globally described variables or regular static variables - the memory is allocated at the moment of loading the MQL-program and is released when unloading the MQL-program
That is, if it's all inside of the EA, the variable will sit in memory until OnDeinit() of the EA?
Norm! seems to compile...
So, if it's all inside EA, the variable sits in memory until OnDeinit() of EA?
Static variables are destroyed after OnDeinit().
Static variables are destroyed after OnDeinit().
Ok! Thanks :)
Help in choosing a broker, where it is best to trade and withdrawal would not be a problem...Thanks
On this resource, naming a broker is tantamount to discussion. And the lullaby does not sleep and threatens reprisals. So look for yourself...
Valeri has the right direction of thought. But I don't understand why we need to define the currency we are looking for in the order currencies at each iteration of the cycle? And I think it's easier to take the margin currency and profit currency instead of looking in the line. Look at the specification for currencies ... I would have done so.
Checked it, it works correctly.
Thanks!