Stop Nasdaq in MT4

 

Hello,

 

I hope somebody can help me.

 

Because the Nasdaq moves in $ 0.25 increments, I look for my expert a way to round a number like 5812.66 to 5812.50 or 5812.45 to 5812.25 etc

 

 Who can give me an exemple how to do this?


Thanks!

 

Hans Blancke

 
double val       = 5812.66;
double increment = 0.25;
double result    = MathRound(val/increment)*increment;

If you want to round down, you would use MathFloor()

If you want to round up, you would use MathCeil()

 
honest_knave:

If you want to round down, you would use MathFloor()

If you want to round up, you would use MathCeil()


Oke thanks!
 
Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it. It's use is always wrong
 
whroeder1:

Do you know a very good EA for the Emini nasdaq? Where and how I can get it? Details and Statistics? Support and contact info? let me know at dormerway@gmail.com . Thanks