Announcement

Collapse
No announcement yet.

Buttons and onClick() handlers for EFS

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Buttons and onClick() handlers for EFS

    An addition to EFS that I think would provide a lot of functionality would be the ability to create small buttons that would be displayed at user-defined locations within the chart window, regardless of scrolling (e.g., bottom-left of chart window, bottom-right, etc.). These buttons would have onClick() handlers associated with them (similar to how Array.sort() is handled now) that could be used to change variables within the script and then call the main() function to recalc the script. This would alleviate the need for the user to go into Edit Script Options repeatedly.

    A simplistic example would be an EFS script that calculates and displays an auto-regression band around current price action. One of the options for this script would be to change the # of StdDevs to use in the calc. If these new buttons were available, we could simply add two buttons to display on the chart: StdDev-- and StdDev++. If the user wanted to increment the standard deviations used in the script, they could click on one of the buttons, the formula would be recalc'd and the bands re-displayed.

    Overall, I could think of many uses for a feature such as this. Just my 2 cents

  • #2
    I really like this idea.

    I don't use EFS at the moment, but this would definitely make it worth my while to worry about making my own studies.

    Comment


    • #3
      Hi Gareth:

      Todd at ESignal was kind enough to point out to me that this capability actually does exist within EFS. In the Alerts formula folder of your ESignal installation there is a sample script called AlertButtons.EFS and this gives an example of how to use a Callback function with buttons in a script. It works very well.

      The only pieces that are missing at this point are:

      1. The ability to anchor the buttons to the chart window (so that they do not move when the chart is scrolled);

      2. A refresh() function that forces the chart to redraw.

      Chris

      Comment


      • #4
        OK, let's talk about this. It was added at my request, so I understand a bit about it.

        1) If you want it to stay in a "chartcentric" vs "timecentric" position, all you would have to do is keep the name of the last unique label and delete it and readd it eachtime a NEWBAR is reported from getBarState().

        2) There is no real way to redraw the study (via EFS) after changing value, though you can have them reflected in future bars. If you do a manual redraw, the new values will be lost (unless you do something clever like write them to disk, and then check for the values in that disk file at the start of the first bar).

        3) However, your specific example could work if you use drawline() commands for the lines and then deleted the old lines and redrew them using the new values once they have been changed. Note that the drawline() routines do not report the values of the lines in the cursor window, so this may not be optimal for you.
        Garth

        Comment


        • #5
          Buttons in EFS

          Hi Garth:

          Your analysis is correct. In my particular case, I am using clearText() and clearLines() and drawLineAbsolute()... and the buttons do provide an effective mechanism for quickly modifying script parameters. You are also correct in that a repaint()/refresh() function callable from within EFS is needed. As it stands now, I must double-click on the buttons I have laid out in my EFS script to affect the change (or single-click and then click anywhere else in the chart object). Still, it beats going into Edit Studies each time I want to make a change.

          Screenshot (hopefully) attached.

          Chris
          Attached Files

          Comment


          • #6
            Pyrapoint?

            Hi Chris.

            Cool chart. What is it, Pyrapoint or something else? Can you tell us something about it how it works?
            Chuck
            @eSignal

            Comment


            • #7
              Interesting chart indeed.

              So, do you delete and redraw the buttons on each NEWBAR, to keep them at the extreme edage of the chart?
              Garth

              Comment


              • #8
                Buttons and EFS

                Hi Chuck & Garth:

                Yes, it is PP which is an adaptation of Gann's Square of 9 developed by Don Hall. You normalize price, determine the correct 'time' factor for the price level traded at, determine the number of squares within squares and plot the column. As price reaches the end of the first column, you create a new column, etc. There are 2 philosophies on this.... Don's original has the 'time' factor remaining constant based upon the anchor price. Howard Arrington's approach creates a price/time curve where the time factor is adjusted as you move up/down through a column. PNG was of Don Hall's original approach... am still working on Arrington's implementation (a little trickier).

                Garth, it is a relatively low-overhead script so I do redraw the whole shooting match as each new bar forms.

                Chris

                Comment

                Working...
                X