sym()

ICE Data Services -

sym() Series Functions


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

 
Syntax

sym( sSymbol )


Parameters

 

Parameter: Description: Default:
sSymbol Required.   String of desired symbol or symbol and interval combination. n/a


Return Value(s)

Returns a Series Object of the close series. 

 

Notes

Only available in versions 7.9 or later.When passing a symbol/interval combination sym(), use a string value that contains the symbol and the interval with an embedded comma in the string (i.e. sym("IBM,60") ).Formulas using sym() 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 sym(). 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.To initialize a Series Object based only on an external interval, use the inv() function instead of sym().


Code Examples

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


See Also

Series Functions
inv()
eSignal Bulletin Board Search Engine
Help Guides and Tutorials