Announcement

Collapse
No announcement yet.

efsExternal - Syntax Fail

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

  • efsExternal - Syntax Fail

    I am getting a syntax error when attempting to use the efsExternal function. (I have Version 7.9 (build 719) )

    Got a little frustrated with a study I was enhancing, so I copied the exact code from one of the simple examples in the EFS2 Development forum, and got the same error. The error is:

    \Wizard\test2.efs, line 17: ReferenceError: efsExternal is not defined

    Both pieces of code are saved in the \Wizard folder. The code I used is as follows:

    function preMain() {
    setPriceStudy(false);
    setStudyTitle("MACD");
    setCursorLabelName("MACD",0);
    setCursorLabelName("MACDSig",1);
    setCursorLabelName("MACDHist",2);
    setDefaultBarFgColor(Color.blue,0);
    setDefaultBarFgColor(Color.red,1);
    setDefaultBarFgColor(Color.magenta,2);
    setPlotType(PLOTTYPE_LINE,0);
    setPlotType(PLOTTYPE_LINE,1);
    setPlotType(PLOTTYPE_HISTOGRAM,2);
    }

    function main(){

    var vExtEfs = efsExternal("test1.efs");

    var vMACD = getSeries(vExtEfs,0);
    var vSig = getSeries(vExtEfs,1);
    var vHist = getSeries(vExtEfs,2);

    return new Array (vMACD,vSig,vHist.getValue(0));
    }

  • #2
    griesha30246
    efsExternal() is not available in version 7.9 build 719. You need version 7.9.1 currently a Release Candidate which can be downloaded here
    Alex

    Comment


    • #3
      esfExternal now ok (Thx) But have associated problem.

      Thank you so much Alexis for your quick reply.

      I loaded the Release Candidate as suggested and the efsExternal call then worked fine. Great!

      I do have another related problem I can't work out. Please help...

      I have been using study-within-study quite successfully with built-in studies but cannot seem to get my own study to work the same (using either efs() or efsExternal() ).

      The code sample is as follows:

      var nCCIStudySlow_X = efs("Fn Gulf CCI v1_9.efs", null, null, 50);
      var vST_Slow_X = ema(5,ema(5,nCCIStudySlow_X));
      if ( bNewBar == true) {
      debugPrintln(" nCCIStudySlow_X = " + nCCIStudySlow_X
      + ", vST_Slow_X = " + vST_Slow_X);
      }

      var nCCIStudySlow = cci(50);
      var vST_Slow = ema(5,ema(5,nCCIStudySlow));
      if ( bNewBar == true) {
      debugPrintln(" nCCIStudySlow = " + nCCIStudySlow
      + ", vST_Slow = " + vST_Slow);
      }
      debugPrintln();
      ....................................


      The output I get is:


      nCCIStudySlow = 49.312612074101445, vST_Slow = 46.12231821145325
      nCCIStudySlow_X = 26.180606517378326, vST_Slow_X = null

      Why am I getting the 'null' return value (please)?

      Comment


      • #4
        griesha30246
        FWIW I am unable to replicate the problem you report. Following is the output I am getting using your sample code calling an external efs.
        Alex

        nCCIStudySlow_X = -59.01982141959808, vST_Slow_X = -29.190974479248254
        nCCIStudySlow = -59.01982141959808, vST_Slow = -29.190974479248254

        nCCIStudySlow_X = 21.804945487640992, vST_Slow_X = -27.505765201441882
        nCCIStudySlow = 21.804945487640992, vST_Slow = -27.505765201441882

        Comment


        • #5
          Send Crash Report?

          I seem to be able to use efs() and efsExternal() quite successfully, though I have given up trying to use the Series they are meant to produce. This is mainly because I don't have the time to investigate properly. However, I will eventually get to the bottom of the problem and let you know what I find.

          In the meantime, I have observed that, if I do a "Save As" of the code I am developing (e.g. I save Fn_XYZ_v1_0 as ....v1_1 - good configuration management, I hope) I find that the efs() I call from within then causes a Syntax Error (not found). Problem is easily overcome by closing the newly saved file and reopening. Syntax check is then ok.

          Hope this helps others.

          Finally, I manage to crash eSignal at least 3 times a day during development (I'm dealing with around 5000 lines of code now). I am offered the opportunity to "Send Crash Report". So, please tell me:

          Is this worthwhile to you (or me, for that matter)?

          If I click OK, will I be sending you a copy of the (precious) code I am developing?

          Regards,

          G.

          Comment

          Working...
          X