Indicator method can accept the following valid forms of input data.
Default Input
Default input of the custom indicator, Market Analyzer column or strategy is used as default input if input is not specified.
double value = SMA(10)[0];
Print("The current SMA value is " + value.ToString());
|
Price Series
Open, High, Low, Close and Volume can all be used as input for an indicator method.
double value = SMA(High, 14)[0];
Print("The current SMA value is " + value.ToString());
|
Indicator
Indicators can be used as input for indicators.
double value = SMA(RSI(Close, 14), 20)[0];
Print("The current SMA value is " + value.ToString());
|
DataSeries
DataSeries can be used as input for indicators.
DataSeries myDataSeries = new DataSeries(this);
double value = SMA(myDataSeries, 20)[0];
|
Bars Object
A Bars object (holds a series of bar object that contain OHLC data) can be used as input for indicators.
double value = SMA(BarsArray[1], 20)[0];
Print("The current SMA value is " + value.ToString());
|
Tips
1. The input series of an indicator cannot be the hosting indicator as it will cause recursive loops.
double value = SMA(this, 20)[0];
|
|