Announcement

Collapse
No announcement yet.

Help Combining BBZ & Zlag in 1 Study, Please

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

  • Help Combining BBZ & Zlag in 1 Study, Please

    Hello,

    In the attached study, I'm trying to combine BBZ & Zlag. I would like to have an alert sound when the upper BB & Lower BB cross over the Zlag or vice versa. However, the BBZ part of the study doesn't show up. Also, I'm sure there has to be a new array , but I'm not sure how to combine a getValue & getSeries, if, in fact, that can be done. Can you help, please?
    Thank you.

    Diane
    Attached Files
    Last edited by Diane P; 11-20-2007, 09:18 AM.

  • #2
    Re: Help Combining BBZ & Zlag in 1 Study, Please

    Diane
    When you combine multiple scripts you need to integrate their logic and not just copy and paste the code from one script into another.
    With regards to the script you posted keep in mind that anything that was added after the return statement in line 188 up to the close of the main function in line 199 will not be executed and needs to be moved to before line 188.
    Also the item returned in the current line 198 needs to be added to the return array currently in line 188.
    Another issue is that you have 2 bInit routines one in lines 120-129 and a second one in lines 134-165. The second one will never get executed because by the time the script evaluates that section of code the bInit flag has already been set to false (in line 127). Again you need to combine these routines into a single one.
    To do this copy lines 121-128 and paste them in place of line 164. You will then need to completely remove the current lines 120-129
    Try making these changes and if you still run into problems post the script as you have modified it and someone will be available to assist you
    Alex



    Originally posted by Diane P
    Hello,

    In the attached study, I'm trying to combine BBZ & Zlag. I would like to have an alert sound when the upper BB & Lower BB cross over the Zlag or vice versa. However, the BBZ part of the study doesn't show up. Also, I'm sure there has to be a new array , but I'm not sure how to combine a getValue & getSeries, if, in fact, that can be done. Can you help, please?
    Thank you.

    Diane

    Comment


    • #3
      Hi Alex,
      Thank you for your help. I didn't realize I was trying to do something so difficult. I think I have done everything you said, but now nothing shows up on the chart. Thanks.
      Diane
      Attached Files

      Comment


      • #4
        Diane
        Sorry that is due to my mistake. In my previous reply the following instruction
        To do this copy lines 121-128 and paste them in place of line 171.
        should have been
        To do this copy lines 121-128 and paste them in place of line 164.
        I have also corrected my previous reply so as not to cause further confusion to anyone else
        Alex


        Originally posted by Diane P
        Hi Alex,
        Thank you for your help. I didn't realize I was trying to do something so difficult. I think I have done everything you said, but now nothing shows up on the chart. Thanks.
        Diane

        Comment


        • #5
          Good Morning, Alex,
          Thanks for the corrections. However, I'm still not seeing anything on the chart. Would,"compute on close", & "ask for input" make a difference? Thanks again.
          Diane
          Attached Files

          Comment


          • #6
            Diane
            The formula is actually giving some syntax errors.
            The first one is caused by an additional closing parenthesis in line 117 ie
            function main(sPrice, nLength, nStdev, Length, Source, Symbol, Interval, Offset, Params)) {
            which should instead be
            function main(sPrice, nLength, nStdev, Length, Source, Symbol, Interval, Offset, Params) {
            The second one is caused by line 153 ie
            if(bInit == false){
            which should not have been copied over as it was in line 120 of your original script. The syntax error is due to the open curly bracket which is never resolved (ie closed) in the function or efs. Comment out (or remove if you prefer) this line and once you save the script it should be working.
            Alex



            Originally posted by Diane P
            Good Morning, Alex,
            Thanks for the corrections. However, I'm still not seeing anything on the chart. Would,"compute on close", & "ask for input" make a difference? Thanks again.
            Diane

            Comment


            • #7
              Alex,
              That did it! Thank you so much for your time & patience. As always, your expertise is so very much appreciated! Have a great Thanksgiving!
              Diane

              Comment


              • #8
                Diane
                You are most welcome.
                A Happy Thanksgiving to you too
                Alex


                Originally posted by Diane P
                Alex,
                That did it! Thank you so much for your time & patience. As always, your expertise is so very much appreciated! Have a great Thanksgiving!
                Diane

                Comment

                Working...
                X