int distance=15; int multiplier=1; double pip_decimal=Point; if(Digits==3) { pip_decimal=Point*10; } if(Digits==5) { multiplier=100; pip_decimal=Point*10; } double round_number=MathRound(Bid*multiplier)/multiplier; if(MathAbs(round_number-Bid)>distance*pip_decimal) { //Do something } Print(DoubleToString(round_number,Digits));
I don't know if this is the best way to do it, but it should work

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
Hello guys, just as the subject. I have an EA and is not doing well in round numers (for example 1.1400 in EURUSD or 136.00 in EURJPY, etc). How can I define that when it´s close to a round number (for example 15 pips of that number) doesn't take the trade?.
Thanks in advance.