-
Notifications
You must be signed in to change notification settings - Fork 14
Indicator API
The following group of methods intended for calculation of standard and custom indicators
Calculates the Bill Williams' Accelerator/Decelerator oscillator and returns its value.
public double iAC(string symbol, int timeFrame, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Bill Williams' Accelerator/Decelerator oscillator.
double result = iAC(null,0,1);Calculates the Accumulation/Distribution indicator and returns its value.
public double iAD(string symbol, int timeframe, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Accumulation/Distribution indicator.
double result = iAD(null,0,1);Calculates the Average Directional Movement Index indicator and returns its value.
public double iADX(string symbol, int timeframe, int period, int applied_price, int mode, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- period - Averaging period for calculation.
- applied_price - Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
- mode - Indicator line index. It can be any of the Indicators line identifiers enumeration value.
- 0 - MODE_MAIN
- 1 - MODE_PLUSDI
- 2 - MODE_MINUSDI.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Average Directional Movement Index indicator.
double result = iADX(null,0,14,PRICE_HIGH,MODE_MAIN,0)Calculates the Alligator indicator and returns its value.
public double iAlligator(string symbol, int timeframe, int jaw_period, int jaw_shift,
int teeth_period,int teeth_shift, int lips_period, int lips_shift,
int ma_method,int applied_price,int mode, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- jaw_period - Blue line averaging period (Alligator's Jaw).
- jaw_shift - Blue line shift relative to the chart.
- teeth_period - Red line averaging period (Alligator's Teeth).
- teeth_shift - Red line shift relative to the chart.
- lips_period - Green line averaging period (Alligator's Lips).
- lips_shift - Green line shift relative to the chart.
- ma_method - MA method. It can be any of Moving Average methods. It can be any of ENUM_MA_METHOD enumeration values.
- applied_price - Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
-
mode - Data source, identifier of the indicator line. It can be any of the following values:
- MODE_GATORJAW - Gator Jaw (blue) balance line,
- MODE_GATORTEETH - Gator Teeth (red) balance line,
- MODE_GATORLIPS - Gator Lips (green) balance line.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Alligator indicator.
double result = iAlligator(null,0,13,8,8,5,5,3,MODE_SMMA,PRICE_MEDIAN,MODE_GATORJAW,1);Calculates the Awesome oscillator and returns its value.
public double iAO(string symbol, int timeframe, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of Awesome oscillator indicator.
double result = iAO(null,0,2);Calculates the Average True Range indicator and returns its value.
public double iATR(string symbol, int timeframe, int period, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- period - Averaging period for calculation.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Average True Range indicator.
double result = iATR(null,0,20,0);Calculates the Bears Power indicator and returns its value.
public double iBearsPower(string symbol, int timeframe, int period, int applied_price, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- period - Averaging period for calculation.
- applied_price - Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Bears Power indicator.
double result = iBearsPower(null,0,13,PRICE_CLOSE,0);Calculates the Bollinger Bands indicator and returns its value.
public double iBands(string symbol, int timeframe, int period, int deviation, int bands_shift,
int applied_price, int mode, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- period - Averaging period to calculate the main line.
- deviation - Number of standard deviations from the main line.
- bands_shift - The indicator shift relative to the chart.
- applied_price - Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
-
mode - Indicator line index. It can be any of the Indicators line identifiers enumeration value.
- 0 - MODE_MAIN
- 1 - MODE_UPPER
- 2 - MODE_LOWER.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Bollinger Bands indicator.
if(iBands(null,0,20,2,0,PRICE_LOW,MODE_LOWER,0)>Low[0]) return(0);Calculates the Bollinger Bands indicator on data, stored in array, and returns its value.
public double iBandsOnArray(Array array, int total, int period, int deviation, int bands_shift,
int mode, int shift)- array - Array with data.
- total - The number of items to be counted. 0 means the whole array.
- period - Averaging period to calculate the main line.
- deviation - Number of standard deviations from the main line.
- bands_shift - The indicator shift relative to the chart.
-
mode - Indicator line index. It can be any of the Indicators line identifiers enumeration value.
- 0 - MODE_MAIN
- 1 - MODE_UPPER
- 2 - MODE_LOWER.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Bollinger Bands indicator, calculated on data, stored in array.
- Unlike iBands(...), the iBandsOnArray() function does not take data by symbol name, timeframe, the applied price. The price data must be previously prepared. The indicator is calculated from left to right. To access to the array elements as to a series array (i.e., from right to left), one has to use the ArraySetAsSeries() function.
if(iBandsOnArray(ExtBuffer,total,2,0,0,MODE_LOWER,0)>Low[0]) return(0);Calculates the Bulls Power indicator and returns its value.
public double iBullsPower(string symbol, int timeframe, int period, int applied_price, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- period - Averaging period for calculation.
- applied_price - Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Bulls Power indicator.
double result = iBullsPower(null,0,13,PRICE_CLOSE,0);Calculates the Commodity Channel Index indicator and returns its value.
public double iCCI(string symbol, int timeframe, int period, int applied_price, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- period - Averaging period for calculation.
- applied_price - Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Commodity Channel Index indicator.
if(iCCI(Symbol(),0,12,PRICE_TYPICAL,0)>iCCI(Symbol(),0,20,PRICE_TYPICAL,0)) return 0;Calculates the Commodity Channel Index indicator on data, stored in array, and returns its value.
public double iCCIOnArray(Array array, int total, int period, int shift)- array - Array with data.
- total - The number of items to be counted. 0 means the whole array.
- period - Averaging period for calculation.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Commodity Channel Index indicator, calculated on data, stored in array.
- Unlike iCCI(...), the iCCIOnArray() function does not take data by symbol name, timeframe, the applied price. The price data must be previously prepared. The indicator is calculated from left to right. To access to the array elements as to a series array (i.e., from right to left), one has to use the ArraySetAsSeries() function.
if(iCCIOnArray(ExtBuffer,total,12,0)>iCCIOnArray(ExtBuffer,total,20,0)) return 1;Calculates the Envelopes indicator and returns its value.
public double iEnvelopes(string symbol, int timeframe, int ma_period, int ma_method, int ma_shift,
int applied_price, double deviation, int mode, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- ma_period - Averaging period for calculation of the main line.
- ma_method - Moving Average method. It can be any of ENUM_MA_METHOD enumeration values.
- ma_shift - MA shift. Indicator line offset relate to the chart by timeframe.
- applied_price - Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
- deviation - Number of standard deviations from the main line.
-
mode - Indicator line index. It can be any of the Indicators line identifiers enumeration value.
- 0 - MODE_MAIN
- 1 - MODE_UPPER
- 2 - MODE_LOWER.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Envelopes indicator.
double result = iEnvelopes(null,0,13,MODE_SMA,10,PRICE_CLOSE,0.2,MODE_UPPER,0);Calculates the Envelopes indicator on data, stored in array, and returns its value.
public double iEnvelopesOnArray(Array array, int total, int ma_period, int ma_method, int ma_shift,
double deviation, int mode, int shift)- array - Array with data.
- total - The number of items to be counted. 0 means the whole array.
- ma_period - Averaging period for calculation of the main line.
- ma_method - Moving Average method. It can be any of ENUM_MA_METHOD enumeration values.
- ma_shift - MA shift. Indicator line offset relate to the chart by timeframe.
- deviation - Percent deviation from the main line.
-
mode - Indicator line index. It can be any of the Indicators line identifiers enumeration value.
- 0 - MODE_MAIN
- 1 - MODE_UPPER
- 2 - MODE_LOWER.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Envelopes indicator, calculated on data, stored in array.
- Unlike iEnvelopes(...), the iEnvelopesOnArray() function does not take data by symbol name, timeframe, the applied price. The price data must be previously prepared. The indicator is calculated from left to right. To access to the array elements as to a series array (i.e., from right to left), one has to use the ArraySetAsSeries() function.
double result = iEnvelopesOnArray(ExtBuffer,10,13,MODE_SMA,0,0.2,MODE_UPPER,0);Calculates the Force Index indicator and returns its value.
public double iForce(string symbol, int timeframe, int period, int ma_method, int applied_price,
int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- period - Averaging period for calculation.
- ma_method - Moving Average method. It can be any of ENUM_MA_METHOD enumeration values.
- applied_price - Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Force Index indicator.
double result = iForce(NULL,0,13,MODE_SMA,PRICE_CLOSE,0);Calculates the Fractals indicator and returns its value.
public double iFractals(string symbol, int timeframe, int mode, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- period - Averaging period for calculation.
- mode - Indicator line index. It can be any of the Indicators line identifiers enumeration value
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Fractals indicator.
double result = iFractals(NULL,0,MODE_UPPER,3);Calculates the Gator oscillator and returns its value.
public double iGator(string symbol, int timeframe, int jaw_period, int jaw_shift, int teeth_period,
int teeth_shift, int lips_period, int lips_shift, int ma_method,
int applied_price, int mode, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- jaw_period - Blue line averaging period (Alligator's Jaw).
- jaw_shift - Blue line shift relative to the chart.
- teeth_period - Red line averaging period (Alligator's Teeth).
- teeth_shift - Red line shift relative to the chart.
- lips_period - Green line averaging period (Alligator's Lips).
- lips_shift - Green line shift relative to the chart.
- ma_method - MA method. It can be any of Moving Average methods. It can be any of ENUM_MA_METHOD enumeration values.
- applied_price - Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
-
mode - Data source, identifier of the indicator line. It can be any of the following values:
- MODE_GATORJAW - Gator Jaw (blue) balance line,
- MODE_GATORTEETH - Gator Teeth (red) balance line,
- MODE_GATORLIPS - Gator Lips (green) balance line.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Gator oscillator.
- The oscillator displays the difference between the Alligator red and blue lines (the upper histogram) and that between red and green lines (the lower histogram).
double result = iGator(null,0,13,8,8,5,5,3,MODE_SMMA,PRICE_MEDIAN,MODE_UPPER,1);Calculates the Ichimoku Kinko Hyo indicator and returns its value.
public double iIchimoku(string symbol, int timeframe, int tenkan_sen, int kijun_sen,
int senkou_span_b, int mode, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- tenkan_sen - Tenkan Sen averaging period.
- kijun_sen - Kijun Sen averaging period.
- senkou_span_b - Senkou SpanB averaging period.
-
mode - Source of data. It can be one of the Ichimoku Kinko Hyo mode enumeration:
- 1 - MODE_TENKANSEN
- 2 - MODE_KIJUNSEN
- 3 - MODE_SENKOUSPANA
- 4 - MODE_SENKOUSPANB
- 5 - MODE_CHIKOUSPAN
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Ichimoku Kinko Hyo indicator.
double tenkan_sen=iIchimoku(null,0,9,26,52,MODE_TENKANSEN,1);Calculates the Market Facilitation Index indicator and returns its value.
public double iBWMFI(string symbol, int timeframe, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Market Facilitation Index indicator.
double result = iBWMFI(NULL,10,0);Calculates the Momentum indicator and returns its value.
public double iMomentum(string symbol, int timeframe, int period, int applied_price, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- period - Averaging period for calculation.
- applied_price - Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Momentum indicator.
if(iMomentum(null,0,12,PRICE_CLOSE,0)>iMomentum(null,0,20,PRICE_CLOSE,0)) return 0;Calculates the Momentum indicator on data, stored in array, and returns its value.
public double iMomentumOnArray(Array array, int total, int period, int shift)- array - Array with data.
- total - The number of items to be counted. 0 means the whole array.
- period - Averaging period (amount of bars) for calculation of price changes.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Unlike iMomentum(...), the iMomentumOnArray() function does not take data by symbol name, timeframe, the applied price. The price data must be previously prepared. The indicator is calculated from left to right. To access to the array elements as to a series array (i.e., from right to left), one has to use the ArraySetAsSeries() function.
if(iMomentumOnArray(mybuffer,100,12,0)>iMomentumOnArray(mybuffer,100,20,0)) return 0;Calculates the Money Flow Index indicator and returns its value.
public double iMFI(string symbol, int timeframe, int period, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- period - Averaging period for calculation.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Money Flow Index indicator.
if(iMFI(null,0,14,0)>iMFI(null,0,14,1)) return 0;Calculates the Moving Average indicator and returns its value.
protected double iMA(string symbol, int timeFrame, int period, int maShift, int maMethod,
int appliedPrice, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- period - Averaging period for calculation.
- maShift - MA shift. Indicators line offset relate to the chart by timeframe.
- maMethod - Moving Average method. It can be any of ENUM_MA_METHOD enumeration values.
- appliedPrice - Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Moving Average indicator.
double result = iMA(null,0,13,8,MODE_SMMA,PRICE_MEDIAN,0);Calculates the Moving Average indicator on data, stored in array, and returns its value.
public double iMAOnArray(Array array, int total, int period, int ma_shift, int ma_method, int shift)- array - Array with data.
- total - The number of items to be counted. 0 means the whole array.
- period - Averaging period for calculation.
- ma_shift - MA shift. Indicators line offset relate to the chart by timeframe.
- ma_method - Moving Average method. It can be any of ENUM_MA_METHOD enumeration values.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Unlike iMA(...), the iMAOnArray() function does not take data by symbol name, timeframe, the applied price. The price data must be previously prepared. The indicator is calculated from left to right. To access to the array elements as to a series array (i.e., from right to left), one has to use the ArraySetAsSeries() function.
- Numerical value of the Moving Average indicator, calculated on data, stored in array.
double macurrent=iMAOnArray(ExtBuffer,0,5,0,MODE_LWMA,0);
double macurrentslow=iMAOnArray(ExtBuffer,0,10,0,MODE_LWMA,0);
double maprev=iMAOnArray(ExtBuffer,0,5,0,MODE_LWMA,1);
double maprevslow=iMAOnArray(ExtBuffer,0,10,0,MODE_LWMA,1);Calculates the Moving Average of Oscillator indicator and returns its value.
public double iOsMA(string symbol, int timeframe, int fast_ema_period, int slow_ema_period,
int signal_period, int applied_price, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- fast_ema_period - Fast EMA averaging period.
- slow_ema_period - Slow EMA averaging period.
- signal_period - Signal line averaging period.
- appliedPrice - Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Moving Average of Oscillator.
if(iOsMA(NULL,0,12,26,9,PRICE_OPEN,1)>iOsMA(NULL,0,12,26,9,PRICE_OPEN,0)) return 0;Calculates the Moving Averages Convergence/Divergence indicator and returns its value.
public double iMACD(string symbol, int timeFrame, int fastEmaPeriod, int slowEmaPeriod,
int signalPeriod, int appliedPrice, int mode, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- fastEmaPeriod - Fast EMA averaging period.
- slowEmaPeriod - Slow EMA averaging period.
- signalPeriod - Signal line averaging period.
- appliedPrice - Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Moving Average of Oscillator indicator.
if(iMACD(null,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)>iMACD(null,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0)) return 0;Calculates the On Balance Volume indicator and returns its value.
public double iOBV(string symbol, int timeframe, int applied_price, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- applied_price - Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the On Balance Volume indicator.
double result = iOBV(null,0,PRICE_CLOSE,1);Calculates the Parabolic Stop and Reverse system indicator and returns its value.
public double iSAR(string symbol, int timeframe, double step, double maximum, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- step - The step of price increment, usually 0.02.
- maximum - The maximum step, usually 0.2.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Parabolic Stop and Reverse system indicator.
if(iSAR(null,0,0.02,0.2,0)>Close[0]) return 0;Calculates the Relative Strength Index indicator and returns its value.
public double iRSI(string symbol, int timeframe, int period, int applied_price, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- period - Averaging period for calculation.
- applied_price - Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Relative Strength Index indicator.
if(iRSI(null,0,14,PRICE_CLOSE,0)>iRSI(null,0,14,PRICE_CLOSE,1)) return 0;Calculates the Relative Strength Index indicator on data, stored in array, and returns its value.
public double iRSIOnArray(Array array, int total, int period, int shift)- array - Array with data.
- total - The number of items to be counted. 0 means the whole array.
- period - Averaging period for calculation.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Unlike iRSI(...), the iRSIOnArray() does not take data by symbol name, timeframe, the applied price. The price data must be previously prepared. The indicator is calculated from left to right. To access to the array elements as to a series array (i.e., from right to left), one has to use the ArraySetAsSeries() function.
if(iRSIOnArray(ExtBuffer,1000,14,0)>iRSI(null,0,14,PRICE_CLOSE,1)) return 0;Calculates the Relative Vigor Index indicator and returns its value.
public double iRVI(string symbol, int timeframe, int period, int mode, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- period - Averaging period for calculation.
- mode - Indicator line index. It can be any of Indicators line identifiers enumeration value.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Relative Vigor Index indicator.
double result = iRVI(NULL,0,10,MODE_MAIN,0);Calculates the Standard Deviation indicator and returns its value.
public double iStdDev(string symbol, int timeframe, int ma_period, int ma_shift, int ma_method,
int applied_price, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- ma_period - Moving Average period.
- ma_shift - Moving Average shift.
- ma_method - Moving Average method. It can be any of ENUM_MA_METHOD enumeration values.
- applied_price - Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Standard Deviation indicator.
double result = iStdDev(null,0,10,0,MODE_EMA,PRICE_CLOSE,0);Calculates the Standard Deviation indicator on data, stored in array, and returns its value.
public double iStdDevOnArray(Array array, int total, int ma_period, int ma_shift, int ma_method,
int shift)- array - Array with data.
- total - The number of items to be counted. 0 means the whole array.
- ma_period - Moving Average period.
- ma_shift - Moving Average shift.
- ma_method - Moving Average method. It can be any of ENUM_MA_METHOD enumeration values.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Unlike iStdDev(...), the iStdDevOnArray() does not take data by symbol name, timeframe, the applied price. The price data must be previously prepared. The indicator is calculated from left to right. To access to the array elements as to a series array (i.e., from right to left), one has to use the ArraySetAsSeries() function.
double result = iStdDevOnArray(ExtBuffer,100,10,0,MODE_EMA,0);Calculates the Stochastic Oscillator and returns its value.
public double iStochastic(string symbol, int timeframe, int KPeriod, int DPeriod, int slowing,
int method, int price_field, int mode, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- KPerid - Period of the %K line.
- DPeriod - Period of the %D line.
- slowing - Slowing value.
- method - Moving Average method. It can be any of ENUM_MA_METHOD enumeration values.
-
price_field - Price field parameter. Can be one of this values:
- 0 - Low/High
- 1 - Close/Close.
-
mode - Indicator line index. It can be any of the Indicators line identifiers enumeration value:
- 0 - MODE_MAIN
- 1 - MODE_SIGNAL.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Stochastic Oscillator.
if(iStochastic(null,0,5,3,3,MODE_SMA,0,MODE_MAIN,0)>iStochastic(null,0,5,3,3,MODE_SMA,0,MODE_SIGNAL,0)) return 0;Calculates the Larry Williams' Percent Range and returns its value.
public double iWPR(string symbol, int timeframe, int period, int shift)- symbol - Symbol name on the data of which the indicator will be calculated. null means the current symbol.
- timeFrame - Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.
- period - Averaging period for calculation.
- shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
- Numerical value of the Larry Williams' Percent Range indicator.
if(iWPR(null,0,14,0)>iWPR(null,0,14,1)) return 0;