Announcement

Collapse
No announcement yet.

New EFS Functionality suggestion. Add new study to chart via EFS.

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

  • New EFS Functionality suggestion. Add new study to chart via EFS.

    The ability to output a button from an EFS is GREAT! However, it would also be nice to take it one step further and have the button add another script to a chart via this button.

    In other words, a script would output a button, the user would click the button and it would add another script to the chart (hard-coded in the EFS). This would be the equivalent of right-clicking on the chart, going to "Formulas", then drilling down to find the particular EFS.

    There is a particular script I created that I use repeatedly (and may have 5-10 instances of that script on a single chart). So, the ability to just click a button to add a new one would be very useful.

    Thanks!
    Daniel
    eSignal File Share: http://share.esignal.com/groupcontents.jsp?groupid=1130

  • #2
    I am not sure how to do exactly what you want, but you can have a button not display the results of an EFS if your button sets a variable which allows/prevents the efs from running by checking the status of that variable in the first line.

    if ( OK=="No") {
    redrawButtons()
    return;

    Rest of EFS here

    Comment


    • #3
      Thanks for the reply. No, I want to actually add a new script on the fly, versus just adding 10 manually, then turning them on and off.

      Also, when I add this new script, I need the param window to come up. Thus, just turning it on wouldn't really buy me much.
      eSignal File Share: http://share.esignal.com/groupcontents.jsp?groupid=1130

      Comment


      • #4
        A unique request / technique, which can be accomplished

        You could create a page which contains a number of the same studies. Keep track of the studies using a true global variable array which would provide indexing functionality for your study buttons, their location, mode and status (or anything else). Then use the buttons to change their status, eg, activate, deactivate, or reinitialize.

        This link describes how to effectively use set/getGlobalValue(). It discusses how you can create an object and obtain a copy (ie reference). Once a reference is obtained, the object can be modified and any change will be shared with all references to the object [without having to continue use of set/getGlobalValue()]. Pretty powerful feature/functionality that can be attributed to the use of the JavaScript platform and its inherent flexibility, at least IMO.

        A couple tips
        • if the global object has not been initialized, getGlobalValue() will return null. if this is the case, create an object and use setGlobalValue() to initialize it.
        • use getInvokerID() to name your global value variables keep track of which chart your in. (Each efs in the chart shares the same invoker id.)
        • use files to remember your configuration and reinitialize it to your preference according to symbol and interval (or any other preference)


        So, based on what you discussed, an efs could be created that would meet your requirements using these techniques.

        Hope this helps.

        Originally posted by neoikon
        Thanks for the reply. No, I want to actually add a new script on the fly, versus just adding 10 manually, then turning them on and off.

        Also, when I add this new script, I need the param window to come up. Thus, just turning it on wouldn't really buy me much.

        Comment


        • #5
          Thanks for the reply. What I need to happen is I need to ask the user for a number input when the new study is added. This can be accomplished with askForInput(), of course. I see now that this can be called within the main() function and not just the premain().

          Perhaps I can just have lots of input params and use askForInput(). I wonder if askForInput() can be called within an event function?

          Thanks for the suggestions. I still think that just having the ability to add another script to a chart via EFS would be my best solution.
          eSignal File Share: http://share.esignal.com/groupcontents.jsp?groupid=1130

          Comment

          Working...
          X