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
Sure - please do follow the NormalizeDouble() recommendation, may not be apparent at first but I have hit subtle bugs when it was omitted.
Good luck with you trading and ongoing coding
I am unfamiliar with NormalizeDouble().. how would I use that in the code? I didn't notice it in your adjustments. Will the win_ratio code work?
Dividing an enum by an enum like that? It feels off, but that's the best way I could think it up.
Now I'm worried about that NormalizeDouble() comment. And Thanks! I appreciate your help!
Like this?
This explanation confused me further:
https://docs.mql4.com/convert/normalizedouble
Like this?
This explanation confused me further:
https://docs.mql4.com/convert/normalizedouble
Yes this works - normalizes to 4 decimal places
But have a look at the 2nd line in the code I posted:Best to do this every time you compare doubles
Dividing an enum by an enum like that? It feels off, but that's the best way I could think it up.
Actually this is not dividing an enum - the TesterStatistics() receives an enum but returns a double
Actually this is not dividing an enum - the TesterStatistics() returns a double
Do the Enums need to be normalized? Or can they remain floating?
Do the Enums need to be normalized? Or can they remain floating?
No Enums are integers.
Only doubles, floats, i.e. all fractional numbers need to have accuracy applied when comparing
No Enums are integers.
Only doubles, floats, i.e. all fractional numbers need to have accuracy applied when comparing
So this isn't overkill?
So this isn't overkill?
No I think it's good. Maybe you could normalize it once and then compare, but personally I prefer leave the numbers as is, and to normalize with every comparison to avoid bugs like I had in the past.
Also in different situations you may like to use different numbers of decimal places, so you can choose that at comparison time if you leave the number as is
No I think it's good. Maybe you could normalize it once and then compare, but personally I prefer to normalize with every comparison to avoid bugs like I had in the past
I guess that answers my last reply. LOL. Thanks again. I'm normalizing the crud out of it now. I've revised this EA soooo many times. On the market, it's like 2.6, but on my computer it's well over 20-30. I think it's 2.9.5 or something.