When trading CFD's which potentially have a minimum increment/tick dimensions of 0.25 in the case of the SP500, I need to discover a method of rounding some like a moving average or ATR into the closest of the tiniest increment.
NormalizeDouble(78.2123,0.25) will trune the 0.25 into the closest number in this case 0 then round to 78
You can also try
Inserted Code double a=78.1251; double ticksize=0.25; a=NormalizeDouble(MathRound(a/ticksize)*ticksize,2); Print(a= DoubleToStr(a,2));