if(maxRSquared < minRSquared)
What is the point of this check? You have declared 2 enums in such a way that any max value will always be greater than any min value.
The stupidity here is unbelievable at times, I have the following:
Then, on initialization. I have the following:
Upon compiling, I get the following:
Why does this complete imbecilic piece of software have no problem converting "maxRsquared" but has a hissy fit about converting "minRsqaured", despite them both being of ENUM type?
Absolutely, unbelievable. Logic beggars belief.
What is the point of this check? You have declared 2 enums in such a way that any max value will always be greater than any min value.
It does not matter what the point is.
No I have not, they're user specified; if the user sets a minimum restriction that is greater than the maximum restriction then the EA will deinitialise.
Now, are you going to continue to ask more questions or are going to provide some insight as to why MT4 has decided it's going to be an arse?
Why does this complete imbecilic piece of software have no problem converting "maxRsquared"
The error message depends on the order of the variables in the expression.
Swap the variables and get the same error message, but with a different variable:
if(minRSquared < maxRSquared) // 'maxRSquared' - cannot convert enum
It doesn't matter which variable is mentioned in the error message. The error lies in the idea of comparing the values of variables belonging to two different enumerations.
If you are using 2 different enums to limit the user's choice of values, then explicitly cast these enums to type int or long when comparing them:
if((int)maxRSquared < (int)minRSquared) // OK
Try doing it properly. See what result you get
It's the result I just showed you - you know, because of the whole "me doing it properly" thing I've got going on here.
So, why - despite me doing it property - is MQL4 decided that this is going to be added to the list of things that is deciding to piss me off and make my life difficult?
Swear to God I have a great big neon sign above my head that is only invisible to me, with a great big arrow that points to my head and says "Please make this persons life a difficult as possible"
Everyone, take note of @ Vladislav Boyko's answer here
This is how you answer a question: not by stupid irrelevant questions. not by passive aggressive bullshit. If everyone actually applied @ Vladislav Boyko's thinking here - this forum would be such a nightmare.
Thank you @ Vladislav Boyko
It's the result I just showed you - you know, because of the whole "me doing it properly" thing I've got going on here.
So, why - despite me doing it property - is MQL4 decided that this is going to be added to the list of things that is deciding to piss me off and make my life difficult?
Swear to God I have a great big neon sign above my head that is only invisible to me, with a great big arrow that points to my head and says "Please make this persons life a difficult as possible"
The error message depends on the order of the variables in the expression.
Swap the variables and get the same error message, but with a different variable:
It doesn't matter which variable is mentioned in the error message. The error lies in the idea of comparing the values of variables belonging to two different enumerations.
If you are using 2 different enums to limit the user's choice of values, then explicitly cast these enums to type int or long when comparing them:
Everyone, take note of this answer.
This is how you answer a question: not by stupid irrelevant questions. not by passive aggressive bullshit. If everyone actually applied this persons thinking here - this forum would be such a nightmare.
Thank you @ Vladislav Boyko, much appreciated and all the best to you.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
The stupidity here is unbelievable at times, I have the following:
Then, on initialization. I have the following:
Upon compiling, I get the following:
Why does this complete imbecilic piece of software have no problem converting "maxRsquared" but has a hissy fit about converting "minRsqaured", despite them both being of ENUM type?
Absolutely, unbelievable. Logic beggars belief.