I've been using the function below for years. It uses round() rather than
modulus and an if statement.
function Round2TickSize(aValue)
{
TickInv = 1 / TickSize;
return (round(aValue * TickInv) / TickInv);
}
Regards,
David
--- In [email protected], David Weir <dwei9...@...> wrote:
>
> Something useful for the group,
>
> http://www.ninjatrader.com/support/forum/showthread.php?t=7582
>
> Enjoy
>
> Cheers
>
> Dave
>
>
>
> On 13/06/10 10:32 PM, "David Weir" <dwei9...@...> wrote:
>
> >
> >
> >
> >
> >
> >
> > Hi
> >
> > Rounding the value from a formula, for a futures contract, to its Tick size
> > for a buy entry price.
> >
> > Any one ?
> >
> > Cheers
> >
> > Dave
> >
> >
> >
> >
>