Download MetaTrader 5

Stop Nasdaq in MT4

To add comments, please log in or register
hansblancke
11
hansblancke  

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

honest_knave
Moderator
2293
honest_knave  
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()

hansblancke
11
hansblancke  
honest_knave:

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

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


Oke thanks!
whroeder1
16572
whroeder1  
Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it. It's use is always wrong
lejeune Bauvil
54
lejeune Bauvil  
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

To add comments, please log in or register