ICE Data Services -

inv() Series Functions

The inv() function is used as a parameter when initializing a Series Object to force the series to be based on an interval that is different than the current interval set in the Advanced Chart for multi-time frame analysis.   Any Series function or Built-in study function that contains the optional parameter, sym() | inv() (sym or inv),  may be based on external intervals with the use of the inv() function.



inv( vInterval )

Parameter: Description: Default:
vInterval Required.   String or Number of desired interval. n/a

Return Value(s)

Returns a Series Object of the close series. 



Only available in versions 7.9 or later.When passing a non-numeric interval value to inv(), a string value must be specified by enclosing the value in quotes (i.e. inv("D") or inv("W") ).Formulas using inv() may be reloaded by the application if a separate chart using a Dynamic time template or a time template set to load more bars makes a secondary request for history on the same symbol's interval used by inv(). This is the default behavior of the application. If this negatively impacts the processing of a custom formulas running in other charts, the solution is to use custom time templates that load the same specific number of bars to avoid the secondary history requests made by other charts. When using multiple interval formulas it is recommended to avoid using Dynamic time templates or time templates that load different number of bars for the same interval in any of the charts present in the layout or page.Typical multi-time frame studies set the external Series Objects' interval to time frames that are higher than the chart interval the formula is applied to.  Lower time frame Series Objects can be used, however, be aware that plotting the result of a lower time frame series will not be able to plot each data point for the lower time frame bars.  Only the last data point that corresponds to the current chart interval can be plotted as there are multiple bars (or data points) for each individual bar of the Advanced Chart interval.To initialize a Series Object that is to be based on an external symbol or symbol and interval combination, use the sym() function instead of inv().

Code Examples

// Global Series Object variable var xStudy = null;
function main() {
  //initialize a Series Object of the sma() for a 60-min interval
  if (xStudy == null) xStudy = sma(10, inv(60));
  //initialize a Series Object of the close() series for a 60-min interval
  if (xStudy == null) xStudy = close(inv(60));
  //retrieve the prior 60-min bar value for the 60-min sma() series
  var myVar = sma(10, inv(60), -1);
  //retrieve the prior day's close for the current chart symbol
  var myVar = close(-1, inv("D"));
  //retrieve the prior day's high for the current chart symbol
  var myVar = high(-1, inv("D"));
  //retrieve the prior day's low for the current chart symbol
  var myVar = low(-1, inv("D"));
  //retrieve the current day's open for the current chart symbol
  var myVar = open(0, inv("D"));

See Also

Series Functions
eSignal Bulletin Board Search Engine
Help Guides and Tutorials