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
I would like to ask the following:
- Why do the following errors show?
- Is the Init/OnInit part of the code optional?
- Is Init same as OnInit? If no, how are they different? I read that Init is for MQL4 and OnInit is for MQL5. Is there any difference other than the syntax?
2. Deinit - shows an error message why the EA failed. I was unable to test it but is this correct?
- Is Deinit same as OnDeinit? as stated above.
- I read that void classes do not return any value. But why does void Deinit (); return the reason for deinitialization?
3. Start - It is said that this is for scripts and not EA. https://docs.mql4.com/runtime/event_fire#start however, it works fine in my EA. Furthermore, a certain EA generator website uses this Start function as a default command which encompasses all OpenBuy, OpenSell, etc orders. Can anyone clarify this?
4. OnTick - It seems to work fine, in the same precise way Start works. But sometimes, Start works but OnTick fails. How can that be? How are the 2 different? The only distinction between them is as said by the abovementioned site, but in my test case it does not seem to be the case.
5. Print - when must the "void" class be included in the code, as the mql4 guide has mentioned in the examples? My experience shows that sometimes it requires the void portion. At times it does not. Is this discrepancy due to the Print() function or the void class? If so, what might that be?
These will be all for now.
I thank you in advance for your patience. Your guidance is very much appreciated. :)
Hahaha... how did this go unnoticed? I seriously think that the whroeder1 account is run by a bot and occasionally checked by a human.
It's been established that there is a bug in the round function for half-rounding. Instead of round you should use
I would like to ask the following:
- Why do the following errors show?
- Is the Init/OnInit part of the code optional?
- Is Init same as OnInit? If no, how are they different? I read that Init is for MQL4 and OnInit is for MQL5. Is there any difference other than the syntax?
2. Deinit - shows an error message why the EA failed. I was unable to test it but is this correct?
- Is Deinit same as OnDeinit? as stated above.
- I read that void classes do not return any value. But why does void Deinit (); return the reason for deinitialization?
3. Start - It is said that this is for scripts and not EA. https://docs.mql4.com/runtime/event_fire#start however, it works fine in my EA. Furthermore, a certain EA generator website uses this Start function as a default command which encompasses all OpenBuy, OpenSell, etc orders. Can anyone clarify this?
4. OnTick - It seems to work fine, in the same precise way Start works. But sometimes, Start works but OnTick fails. How can that be? How are the 2 different? The only distinction between them is as said by the abovementioned site, but in my test case it does not seem to be the case.
5. Print - when must the "void" class be included in the code, as the mql4 guide has mentioned in the examples? My experience shows that sometimes it requires the void portion. At times it does not. Is this discrepancy due to the Print() function or the void class? If so, what might that be?
These will be all for now.
I thank you in advance for your patience. Your guidance is very much appreciated. :)
Up. :)
Hahaha... how did this go unnoticed? I seriously think that the whroeder1 account is run by a bot and occasionally checked by a human.
Please stop that behaviour.
Forum on trading, automated trading systems and testing trading strategies
General rules and best pratices of the Forum.
Alain Verleyen, 2018.03.11 19:44
Forum rules, enforced by moderators :
Your statement is a direct attack on WHRoeder and is not acceptable.I hope you will agree we have to stop repeating the errors of the past.
nicholishen:
It's been established that there is a bug in the round function for half-rounding. Instead of round you should use
Actually what is established is that MathRound() and NormalizeDouble() are rounding in a different way. Nothing more. Half rounding up is the common method, but it's not the only one, and it's not mandatory.
Saying now that one should always use NormalizeDouble() while rounding (normalizing to tick) a price, is not better than saying that NormalizeDouble() usage is always wrong.