DDEOutput Object

ICE Data Services -

DDEOutput Object
Previous  Top  Next


DDEOutput Object

The DDEOutput Object allows EFS to output formula data to Excel via a DDE interface.

DDEOutput Methods

set(value)
pass value to the DDE client


Usage

var study      = null;
var dde      = new DDEOutput( "movavg" + getSymbol() );
var bInit      = false;

function preMain() {

   setPriceStudy(
true);

}

function main() {
var retVal;

   
if ( bInit==false ) {
      
//create an EMA study
      study = ema( 
10 );
      bInit=
true;
   }

   
//gather the current value from the study
   retVal = study.getValue(
0);

   
//if it is not null, assign it to our DDE object
   
if ( retVal != null) dde.set( retVal );

   
return( retVal );
}



Setup instructions for Excel

1. EFS formula with DDEOutput object must be running.  
2. In Excel, enter a DDE formula with the following format: =eSignal|EFS!movavgIBM  
 
The Excel configuration above would require that the example formula above be running on a chart of IBM. When the DDEOutput object is initialized in the EFS script (i.e., var dde = new DDEOutput(sItem)), 'sItem' becomes the string that needs to be referenced in the Excel formula. In our example above sItem becomes "movavgIBM".
You can create multiple DDE objects within a single script. For example, if you implement a script that calculates 5 different indicators, you could create a DDEOutput Object for each indicator (remember to assign each DDEObject a unique string identifier) and then retrieve that same information from within an Excel spreadsheet.

 

Notes:

The identifier string used for the DDE formula in Excel cannot contain any special characters or spaces.  If you use the get Symbol() function to build the identifier string, you can use the String.replace() method to parse these items from the string.  Please visit the following thread, Moving Average from eSignal into Excel, to see a complete formula example.