[MT4/MQL4] check equal or not conditions for double / double 值比較
bool checkDoubles(double a, double b, string check) { if(check==">"){ if (a - b > Point / 2)return(1);else return (0); }else if(check=="<"){ if (b - a > Point / 2)return(1);else return (0); }else if(check==">="){ if (a - b > -Point)return(1);else return (0); }if(check=="<="){ if (b - a > -Point)return(1);else return (0); }else if(check=="!="){ if (MathAbs(a - b) > Point / 2)return(1);else return (0); }else { Print("Sorry you've entered a wrong check value"); } return (0); }
Ref: https://www.mql5.com/en/forum/136997/page2#593570
留言
張貼留言