Forums › ProRealTime English forum › ProOrder support › round down/up › Reply To: round down/up
07/23/2017 at 2:45 PM
#41415
ROUND() rounds numbers to the nearest whole number, the documentation is a bit poor, since it shows only the rounding of 9.60.
I tested this fake strategy (one buy instrution is necessary to be executed) with returns wit no addiotion, adding 0.9 and 0.4, both with positive and negative values, in case you want ALWAYS round to the greatest or to the smallest whole number:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
// returns // +0.0 +0.9 +0.4 //a = round(2.0 + 0.4) // 2 3 2 //b = round(2.4 + 0.4) // 2 3 3 //c = round(2.5 + 0.4) // 3 3 3 //d = round(2.6 + 0.4) // 3 3 3 //e = round(2.7 + 0.4) // 3 4 3 a = round(-2.0 + 0.4) // -2 -1 -2 b = round(-2.4 + 0.4) // -2 -2 -2 c = round(-2.5 + 0.4) // -3 -2 -2 d = round(-2.6 + 0.4) // -3 -2 -2 e = round(-2.7 + 0.4) // -3 -2 -2 GRAPH a AS "a" GRAPH b AS "b" GRAPH c AS "c" GRAPH d AS "d" GRAPH e AS "e" buy 1 contract at market |