See Odd comparing two doubles
int x = double y ?
Comparsion Problem
int x = double y ?
Comparsion Problem
Rosh:
See Odd comparing two doubles
int x = double y ?
Comparsion Problem
See Odd comparing two doubles
int x = double y ?
Comparsion Problem
I looked into those threads and it seems that the solutions were to use the "NormalizeDouble" subroutine.
would it be better just to define my MAs as strings? i already used that subroutine and it still didn't work.
You didn't use it here:
if (thspos >= (lstpos + MinAng*Point)) {return(1);} //up
if (thspos <= (lstpos - MinAng*Point)) {return(2);} //down
yup that did the trick phy.
it seems it didnt carry over from when i declared them.
it seems it didnt carry over from when i declared them.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
ive bin really, really trying to code an EA function that would do the following.
It would find the value of the MA in the last two closed bars and see if their is a difference of 'MinAng' in are case 5, between the two and in what direction.
ex.
shift 1 - 2.0325 (one bar back)
shift 2 - 2.0321 ( two bar back)
25
-21
____
4 4 is not equal or greater than 5 so return 0
I've tryed the following but it only works some of the time and only when the difference is greater than 5... not equal.
extern int angle = 5;
the rest of the code that involves this function is with the buy/sell. but that only uses the what it returns (1, 2, 0).