Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 335
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
Before inserting the code, it's a good idea to go through it with a styliser (ctrl+, in the meta-editor) to make it easy to read.
But I won't bother you anymore. We need return-types to return integer values/variables, because all code is written inint start() function
Before inserting the code, it's a good idea to go through it with a styliser (ctrl+, in the meta-editor) to make it easy to read.
But I won't bother you anymore. You need return-types to return integer values/variables, because all code is written inint start() function
It's just not clear what exactly to write there in many points.
Could you specify return values in the code?
the code seems to be quite simple
it would be much clearer
or tell me how to avoid return function, if it's possible of course
It's just that at many points it's not at all clear what exactly to write there
Could you please write values for return in the code?
the code seems to be quite simple
it would be much clearer
or tell me how to do without return function, if it is possible.
int start()
void OnTick()
int start()
void OnTick()
and when to leave the rest unchanged?
It's just that at many points it's not at all clear what exactly to write there
Could you please write values for return in the code?
the code seems to be quite simple
it would be much clearer
or tell me how to avoid return function, if it's possible.
There is only one function in the code - Start(). You do not really care what to return. Write return(0); everywhere and everything will be ok.
This code (similar to code from Kovalev's tutorial) was written when it was not necessary to return a value from a function with a type other than void.
and when to leave the rest unchanged?
By the way, it's even better that way. Vitaly advised correctly. It will comply with the new style and save us from the necessity of returning values. However, there might be warnings where values are returned. Then remove the returned values.
Normally, you have to delete all the code and rewrite it
Doesn't that scare you?
Normally, you have to delete all the code and rewrite it
Doesn't that scare you?
Still haven't fixed it properly)).
I didn't look there so it doesn't scare me... The code without the stylizer already scares me, so I just found the name of the function and calmed down.
By the way, it will be even better. Vitaly gave us the right advice. It will comply with the new style and will eliminate the need to return values. However, there can be warnings where values are returned. Then remove the returned values.
changed to void OnTick() and no more warnings
I have two more questions, if I may
1)I stuck this expert in the tester
and it generates a warning
Can you tell me what it means (on the picture)?
2) What literature should I read to get a better understanding of mql4 programming?
changed to void OnTick() and no more warnings
I have two more questions, if I may
1)I stuck this expert in the tester
and it generates a warning
Can you tell me what it means (on the picture)?
2) What literature should I read to get a better understanding of mql4 programming?
It's ok, no warnings. Use it as it is.