See Odd comparing two doubles
int x = double y ?
Comparsion Problem
int x = double y ?
Comparsion Problem
You didn't use it here:
if (thspos >= (lstpos + MinAng*Point)) {return(1);} //up
if (thspos <= (lstpos - MinAng*Point)) {return(2);} //down
You agree to website policy and terms of use
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).