RoundToTickSize()

View as Markdown

Definition

Returns a value that is rounded up to the nearest valid value evenly divisible by the instrument’s tick size.

Method Return Value

A double value.

Syntax

Instrument.MasterInstrument.RoundToTickSize(double price)

Parameters

ParameterDescription
priceA double value representing a price

Examples

1//Takes the last 3 closes, divides them by 3, and rounds the value up to the nearest valid tick size
2Value[0] = Instrument.MasterInstrument.RoundToTickSize((Close[0] + Close[1] + Close[2]) / 3);