Announcement

Collapse
No announcement yet.

Retrieving Volume data via DDE

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Retrieving Volume data via DDE

    Greetings,

    I am trying to "pull" volume via DDE into Excel from a couple of 3min charts. Reading through the thread(s), I used one of the samples as a template, however I can't seem to get it to function correctly.

    The value always remains at "0".

    Here is the code;

    var dde1 = null;

    function preMain() {

    setStudyTitle("Volume4 Test");
    setCursorLabelName("Volume",0);
    setPlotType(PLOTTYPE_HISTOGRAM,0);
    }


    function main() {
    if (dde1 == null) {
    var sName = ("Vol_" + getSymbol() +"_"+ getInterval());
    sName = sName.replace("$", ""); // remove $ from string
    sName = sName.replace("#", ""); // remove # from string
    sName = sName.replace("-", ""); // remove # from string
    sName = sName.replace(" ", "_") // replace space with underscore
    debugPrintln("DDE Link for Excel =eSignal|EFS!"+sName);
    dde1 = new DDEOutput(sName);
    }

    return getValue("Volume");

    return dde1.set("Volume");

    }


    Here are some samples of syntax used in the worksheet:

    =eSignal|EFS!Vol_GOOG_3
    =eSignal|EFS!Vol_GBP_A0FX_3

    Any ideas/feedback would be appreciated.

    Axel

  • #2
    Axel
    Replace the following two lines of code
    PHP Code:
    return getValue("Volume");

    return 
    dde1.set("Volume"); 
    with the following
    PHP Code:
    var vVolume getValue("Volume");
        if(
    vVolume==null) return;

        
    dde1.set(vVolume);
        
        return 
    vVolume
    Once you implement this change the DDE links you posted as samples should work
    Alex

    Comment

    Working...
    X