getSeries()

ICE Data Services -

getSeries() Series Functions

This function converts the return value of a data series back into a Series Object or to access a specific Series Object within an array of Series Objects in the return array of efsInternal() or efsExternal().

Syntax
getSeries( returnVal [, nSeriesIndex ] )

Parameters
Parameter: Description: Default:
returnVal Required. 
Series or return value.

 

n/a nSeriesIndex [Optional]  Number for the array element position in the returned array.

 

n/a
Return Value(s)
Returns a Series Object.

Notes
This function in only available in version 7.9 (build 719) or later.

Code Examples
The following code example ensures that the data in the return array are in the Series Object form, which important for multiple interval studies where the user wants to see the synchronized plot of the external interval data.

var myStudy1 = null; var myStudy2 = null; var bInit = false; function main() {    if ( bInit == false ) {              //create a 20-period EMA using 30-min bars       myStudy1 = ema( 20, inv(30) );       //create a 20-period EMA using 60-min bars       myStudy2 = ema( 20, inv(60) );       bInit = true;    }    //use getSeries() to ensure that the actual series is being returned, rather than the values    return new Array( getSeries( myStudy1 ), getSeries( myStudy2 ) ); }



The following code example uses getSeries() to access the individual Series Objects that are returned in an array from efsInternal() or efsExternal().  This example only uses efsInternal().  However, the coding process is exactly the same if using efsExternal().

var xExample = null;var myStudy1 = null; var myStudy2 = null; var bInit = false; function main() {         if ( bInit == false ) {         // create a Series Object using efsInternal() that        // returns a array of two Series Objects        xExample = efsInternal("testExample");                 bInit = true;             }         // Use the getSeries() function assign global variables     // to each Series Object returned by xExample.        if (xExample != null) {        // myStudy1 becomes Series Object of ema(10).        if (myStudy1 == null) myStudy1 = getSeries( xExample, 0 );        // myStudy2 becomes Series Object of ema(20).        if (myStudy2 == null) myStudy2 = getSeries( xExample, 1 );    }        return new Array( myStudy1 , myStudy2 ); }function testExample() {    return new Array( ema(10), ema(20) );}


See Also
Series Functions
eSignal Bulletin Board Search Engine
Help Guides and Tutorials