MetaTrader 4 Build 529 beta released with new compiler - page 18
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
Has the MQL4 handbook (which is in the editor) also been updated accordingly?
yes with a request to update. The MQL4handbook is almost based on 5 and does not correspond to the compiler's realities at the moment.
Correct me if I got it wrong.
I use a library function in an indicator, this function declares some static variables that participate in the calculation of the indicator array.
If I want to change the indicator parameters in order to correct indicator calculation (depending on static variables),
pass the flag to the library function that is responsible for reinitialization (you should expand the input parameters of each function that has static variables)
make zeroing of static variables in the body, and do not forget to remove the flag before completing the calculation.
It would be much easier if static variables had some parameter, set during their declaration, responsible for whether these variables will be reset to zero during reinitialization.
It would be much simpler if static variables had some parameter to be set when they are declared, responsible for whether or not the value of these variables would be reset on reinitialization.
It would be even easier, if developers make special function like ResetStaticVars().
// By the way, it's not so easy to do. I wouldn't. It's one thing to simply zeroize the entire data segment, and another thing is to correctly assign all user initial values. A pain in the neck, though.
Actually (as a paradigm) saving values during the life of the program is rather convenient. There is just a question of backward compatibility here, so...
I know that this is a Russian speaking part of the forum, but since I am bad at talking Russian (even though I can read it) hope nobody will mind posting this here (since the English part seems completely inactive as far as these issues are concerned and since I did not see that someone posted about this issue)
There is one serious issue with the new metatrader that concerns external string parameters. Initially they have a correct value, but as soon as time frame or symbol is changed the content of a string parameter is lost. Here is a simple example that will show exactly what is happening. That issue also happens when such indicators are used through iCustom() call and that makes any such indicator unusable from any EA or other code
Yes with the update request. The handbook for MQL4 is almost based on 5 and doesnot correspond to the realities of the compiler at the moment.
maybe they left something there that is in the near future? i'm counting on it.
Has the MQL4 handbook (which is in the editor) also been updated accordingly?
I can't figure out why we need a design like this
#property icon "\\Files\\button.ico"
I can't figure out why we need a design like this
I know that this is a Russian speaking part of the forum, but since I am bad at talking Russian (even though I can read it) hope nobody will mind posting this here (since the English part seems completely inactive as far as these issues are concerned and since I did not see that someone posted about this issue)
There is one serious issue with the new metatrader that concerns external string parameters. Initially they have a correct value, but as soon as time frame or symbol is changed the content of a string parameter is lost. Here is a simple example that will show exactly what is happening. That issue also happens when such indicators are used through iCustom() call and that makes any such indicator unusable from any EA or other code
Mladen, it's easier for me to answer in Russian, since you are fluent in reading.
Here is my solution to this problem. In my init() code I include the ReInit() function which re-initializes those global variables, whose values should be restored when the timeframe or the symbol changes: