Announcement

Collapse
No announcement yet.

Linear Regresion DDE

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

  • Linear Regresion DDE

    Can someone post the EFS/DDE link script to export the Linear Regression study?

    I have created DDE script for a bunch of MAs...Stochs... PSAR.... but am having some real trouble getting this LinReg to work...

    I started using this but am being told that the LinReg Study is not defined:


    var dde = new DDEOutput("LinReg" + getSymbol());

    function preMain() {
    setPriceStudy(false);
    }

    var study = null;

    function main() {

    if(study==null) study = LinReg;

    var vRet = study.getValue(0);
    if(vRet != null) dde.set(vRet);

    return vRet;
    }

  • #2
    Re: Linear Regresion DDE

    IOWA
    The reason for the error message is that the syntax for the Linear Regression function used in the following line of code of your script ie
    if(study==null) study = LinReg;
    is invalid. The function name for what I think you are trying to accomplish [ie simply send the current value of the Linear Regression to an Excel sheet] would be middleLinearReg().
    For the description and complete syntax of this function see this article in the EFS KnowledgeBase
    Alex


    Originally posted by IOWA
    Can someone post the EFS/DDE link script to export the Linear Regression study?

    I have created DDE script for a bunch of MAs...Stochs... PSAR.... but am having some real trouble getting this LinReg to work...

    I started using this but am being told that the LinReg Study is not defined:


    var dde = new DDEOutput("LinReg" + getSymbol());

    function preMain() {
    setPriceStudy(false);
    }

    var study = null;

    function main() {

    if(study==null) study = LinReg;

    var vRet = study.getValue(0);
    if(vRet != null) dde.set(vRet);

    return vRet;
    }

    Comment


    • #3
      Still not sure what im doing wrong.... i used the script from your previous post and can get any of the middle/upper/lower Linear Regression lines plotted on my chart - but can't get the DDE script to pull it into Excel.... I am getting "0" everytime:

      var dde = new DDEOutput("middleLinearReg" + getSymbol());

      function preMain() {
      setPriceStudy(false);
      }

      var study = null;

      function main() {

      if(study==null) study = "middleLinearReg";

      var vRet = study.getValue(0);
      if(vRet != null) dde.set(vRet);

      return vRet;
      }

      function preMain() {

      setPriceStudy(false);
      setStudyTitle("middleLinearReg");
      setCursorLabelName("middleLinearReg", 0);
      setDefaultBarFgColor(Color.blue, 0);
      setPlotType(PLOTTYPE_LINE,0);
      setDefaultBarThickness(1,0);
      }

      function main() {

      return middleLinearReg(1600, 2, hl2());
      }

      Comment

      Working...
      X