• #1 by PFawcettZ on 20 Jul 2021
  • Good Afternoon 

    Can someone suggest a way of implementing lt_ma into the price field but making the value valid so rounding the number up in each instance to the nearest tick; 
    i.e - 5.55 to 5.6 
    2.024 to 2.04 
    1.778 to 1.8 etc

    Your advice will be most appreciated. 

  • #2 by Purity on 20 Jul 2021
  • INTEGER(lt_ma) would probably get you most of the way there, but will probably round down.

    r_ticks(INTEGER(lt_ma),1) will round up, but might add an 'extra' tick depending on the price.

    If the rounding goes both ways depending on lt_ma then conditionals should cover it (not sure I've written this correctly, but something like):

    IF(INTEGER(lt_ma) < r_ticks(INTEGER(lt_ma),1), r_ticks(INTEGER(lt_ma),1), INTEGER(lt_ma))
  • #3 by PFawcettZ on 21 Jul 2021
  • Hi

    Unfortunately this rounds down to the nearest whole number + or - 1 tick. I need it to round down to the nearest tick. In this instance it is rounding down from 3.95 to 3.00 + 1 tick = 3.05. Or less 1 tick 2.98. thanks for the suggestion but anyone have a solution? 
  • #4 by MarkV on 21 Jul 2021
  • Hi
    Have you tried: r_ticks(lt_ma, 0)