Announcement

Collapse
No announcement yet.

Help, please with return on LR ext.

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

  • Help, please with return on LR ext.

    Hello,
    I'm trying to add an extension to a linear regression indicator, but I can't get a proper return. Can you please help? Thank you.
    Diane
    Attached Files
    Last edited by Diane P; 07-02-2006, 05:17 PM.

  • #2
    Diane
    There are a couple of errors in the script.
    The first one is that there is an extra closing curly bracket in line 24.
    The second is that while you do correctly transfer the value of LR to LR_1 at every new bar you then omitted to assign a value to LR. To correct this insert a line after the following section of code
    if(getBarState()==BARSTATE_NEWBAR){
    LR_1=LR;
    }

    and in it add the following
    LR = wt;
    This will assign the value of wt to the variable LR.
    Then insert another line after that and in it add
    if(LR==null||LR_1==null) return;
    This is a null check on the LR and LR_1 values before you use them as parameters of the addLineTool() function else you will get an invalid parameter error message.
    Once you implement these changes the efs will work correctly
    Alex

    Comment


    • #3
      Good Morning, Alex,
      Thanks again for your most valued help. Have a great 4TH!
      Diane

      Comment


      • #4
        Diane
        You are most welcome and a great 4th to you too
        Alex

        Comment


        • #5
          Please post corrected EFS.

          Thanking You in Advance.

          Comment


          • #6
            Hi Avery,
            Per your request.
            Diane
            Attached Files

            Comment


            • #7
              Ok.. I'll have a look.

              Comment

              Working...
              X