I guess I could normalize it once after specifying the double constant and all the if else code would comply with the normalized constant? Or would I have to normalize it each time I was comparing it to something else?
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.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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.