GetInstrument()

View as Markdown

Definition

Returns an Instrument object by the master instrument name configured in the database.

This method does NOT add additional data for real-time or historical processing. For adding additional data to your script, please see the AddDataSeries() method.

Method Return Value

An Instrument object

Syntax

Instrument.GetInstrument(string instrumentName)

Parameters

ParameterDescription
instrumentNameA string value representing a name of an instrument

Examples

1protected override void OnStateChange()
2{
3 if (State == State.Historical)
4 {
5 Instrument myInstrument = Instrument.GetInstrument("AAPL");
6
7 Print("AAPL's tick size is " + myInstrument.MasterInstrument.TickSize.ToString());
8 }
9}