Have looked on the Microsoft website and the boffins can't give a moron like me a straight answer so hoping to get one here.
How do I round a number to an integer?
Example I want to set a stop of 2 * ATR(14)[1].
If the value of the 14 period ATR 1 bar ago was 2.37 then 2 * 2.37 = 4.74 so I want my stop to be set 4 points from my entry if I round down or 5 points from entry if I round up.
Am thinking ............execution.Order.AvgFillPrice - (Math.Round(2*ATR(14)[1])) .........but it wouldn't know whether to round down or up. So is there a 'rounddown' or 'roundup' keyword / operator?
Thanks in advance,
Ben.
Comment