Announcement

Collapse
No announcement yet.

Linear Reg rev

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

  • Linear Reg rev

    \Wizard\FDLC\Linear Regresion Reversal.efs, line 27: SyntaxError: invalid return:
    return 1;

    need help to solve this syntax error

  • #2
    juano
    You may want to post the efs.
    Alex

    Comment


    • #3
      LRR

      function preMain()
      {
      setStudyTitle("Linear Reg Reversal");
      setCursorLabelName("LRR",0);
      setDefaultBarFgColor(Color.green,0);
      setDefaultBarThickness(2,0);

      }

      function main(Length) {
      if(Length==null)Length=5;
      var sum=0;
      var i=0;
      var mt=0;
      var WT=0;
      var vWT2=getGlobalValue("WT2");
      }

      for(i=Legth;i>0;i--)
      sum +=(i-(Legth+1)/3)*close(i-Length);
      WT=6/(Length*(Length+1))*sum

      if(WT>=vWT2)
      {
      setGlobalValue("WT2",WT);
      return 1;
      }
      else
      {
      setGlobalValue("WT2",WT);
      return -1;
      }

      return;

      }

      Comment


      • #4
        juano
        I think the attached efs is the script you want
        Alex
        Attached Files

        Comment

        Working...
        X