NinjaScript > Language Reference > Data >

Input

Print this Topic Previous pageReturn to chapter overviewNext page

Definition

The main data input.

 

Property Value

A data series type object that implements the IDataSeries interface. Accessing this property via an index value [int barsAgo] returns a double value representing the price of the referenced bar.

 

Syntax

Input
Input[int barsAgo]

 

 

Examples

// Prints the the current value of input
Print(Input[0].ToString());

 

 

Tips

1.Input represents the input data source of the indicator. If you implement an indicator where PriceTypeSupported is set to true, then when referencing the input data source value, you will want to reference Input[0] instead of Close[0]. This is because Input[0] will return the data value of the seleced PriceType.
2.When working with multi-series indicators, Input always references BarsInProgress 0. Please be mindful as to when you access Input[0] as you will only be able to do so after BarsInProgress 0 has bars. To check to ensure BarsInProgress 0 has some bars you can use CurrentBars[0] to check.