I'm not really clear on what you are trying to do, but does NormaliseDouble with the appropriate rounding digit not work?
Or
I guess you could multiply by the required factor, cast it to an int to drop off the remaining decimals and divide by the factor casting it back to a double. That will give you the lower round number so just add your step to get the upper round number.
It's maybe 'cos it's Friday, but I can't get my head around what your code is trying to do.
V
beats me..
int tmpvalue= Bid/Point; tmpvalue=tmpvalue-(tmpvalue%50); double LowerRound=tmpvalue*Point; double UpperRound=(tmpvalue+50)*Point;
not tested, but the idea should work on 4 digits broker
zzuegg:
not tested, but the idea should work on 4 digits broker
thanx works just fine
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
Can somebody share with a code that looks for round numbers
at EA. One round number above bid and one round number below. Like 00 or 50.
I spent many many hours and no success.
Logically the code above should work and it does not.
Thank You.