Announcement

Collapse
No announcement yet.

Loss of wave file in Buttons when using ComputeOnClose()

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

  • Loss of wave file in Buttons when using ComputeOnClose()

    Hi everyone! Can anyone help me with this problem that has me stumped?

    Why is it, that when ComputeOnClose() is set, that I loose wave file sounds on buttons?? I have written a simple code for a few buttons with wave files. By clickling on the buttons they play wave files, but only when commenting out "computeonclose()" in preMain().


    Being new to code writing , I still get stumped on the obvious...
    one of which is the ComputeOnClose() feature. I usually loose the color bars of my graphs or loose sound files, esp. when I use if(getCurrentBarIndex == 0) in conjunction with computeonclose().

    Any help would be appreciated. Thanks !

    angelo
    Attached Files
    ang.

  • #2
    angelo
    The reason why events are not triggered when you have setComputeOnClose() and if(getCurrentBarIndex()==0) is because with setComputeOnClose() bar index 0 is never processed. The most current bar being processed in that case is bar index -1. Try replacing getCurrentBarIndex()==0 with getCurrentBarIndex()==-1
    I believe that this is also the reason why sound alerts are not being triggered with setComputeOnClose()
    Alex

    Comment


    • #3
      Thanks Alex for your reply. I changed the parameters and it works now.
      I have another problem with an efs that I'm tinkering with....I'm calling it by efsExternal(). I can't seem to get the color bars to color. The mavg's plot fine, but I loose the colors on the bars. Posted code for anyone to look at. Thanks again for your help, as always, you're a great help and life savoir to those who lag behind in programming.

      Angelo
      Attached Files
      ang.

      Comment


      • #4
        Angelo
        You are most welcome.
        You will need to post the calling efs as the one you included in your message does not provide any indication as to why the bars are not being colored.
        Alex

        Comment


        • #5
          Grazie Alexis.... here is the called file I am extracting and utilizing some of the variables from.
          It works fine when I open it , but not in a called file status. Could it be the way an array is called???

          Your help is always appreciated ......... Una Faccia.... una Ratsa!Angelo
          Attached Files
          ang.

          Comment


          • #6
            Angelo
            The efs you posted in your last message is the same as the one your posted previously.
            You need to post the calling efs ie the one that contains the efsExternal() function
            Alex

            Comment


            • #7
              Hi Alex,

              Sorry about that... this is the original script I modified. I called the modified in the program.

              But there lies the confusion. If the modified script color correctly, then why not when it is called in another program?

              Again, thanks for your expertise !!!

              Angelo
              Attached Files
              ang.

              Comment


              • #8
                Angelo
                I am not sure I understand what the problem is. Neither of the scripts you posted is coloring the price bars or contains an efsExternal() call as you indicated in a prior message.
                Also as far as I can see the values returned by the two scripts are identical.
                Alex

                Comment


                • #9
                  Ok, I'm having one of those stupid " brain freeze" moments, and I
                  apologize for the error!

                  Here is the program with the call.( I forgot that I renamed the program...) . It doesn't paint the color bars, however , it does paint the other two arrays correctly, however, I believe the values are off.

                  The called file does paint the bars and Ma's correctly. The called file is a modified script from an original script that was posted in the prior post below, without the trading bands.

                  Again, thanks for your patience.

                  Angelo
                  Attached Files
                  ang.

                  Comment


                  • #10
                    Angelo

                    It doesn't paint the color bars, however , it does paint the other two arrays correctly

                    When using the setColorPriceBars(true) statement in preMain() you also need to provide a default color using
                    setDefaultPriceBarColor(Color.yourcolor)
                    Having said that I do not see anywhere in the calling script that you are painting the price bars

                    however, I believe the values are off.

                    That is because you are passing a source ie hlc3() that is not valid for the efs you are calling. The source parameter should be "HLC/3" (with the quotes). You can see the list of valid sources in the Function Parameter of the called efs in lines 151-157
                    Alex

                    Comment


                    • #11
                      Thanks Alex for your help...... I changed the param and got rid of Price Color Bar and now all works fine.

                      The errors made are from the lack of knowledge (and understanding) of EFS. I used the hlc3() because I saw it used in a series function. I didn't realize when calling a script, you must pass the param exactly as it is in the called program( including the quotes).

                      The simple fix really helped me to further understand how to use calling functions in EFS2.

                      Again, you're always there when we need you. Keep up the good work!!!

                      angelo
                      ang.

                      Comment

                      Working...
                      X