NinjaScript > Language Reference > Data > Instrument >

MasterInstrument.Round2TickSize()

Print this Topic Previous pageReturn to chapter overviewNext page

Definition

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

 

Method Return Value

A double value.

 

Syntax

Instrument.MasterInstrument.Round2TickSize(double price)

 

Parameters

price

A double value representing a price

 

Additional Access Information
This property can be accessed without a null reference check in the OnBarUpdate() event handler. When the OnBarUpdate() event is triggered, there will always be an Instrument object. Should you wish to access this property elsewhere, check for null reference first. e.g. if (Instrument != null)