Announcement

Collapse
No announcement yet.

"Execute EFS" Button Problem

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

  • "Execute EFS" Button Problem

    Hello....

    I have attached an "Order Ticket" panel into my charts and I want to add a "Execute EFS" button onto the panel.

    Under "edit template", "properties"...."EFS Formula", I have browsed to and saved the EFS I created.

    Under "Add Button" ....i selected "Execute EFS" as the action......and EFS, EFS Function, EFS : I gave it a name/description.

    Problem is.....nothing happens when i click the button. Am i missing a obvious step or entered something incorrectly ?

    note....if I R Click on chart and go to "Formulas" to where my EFS is listed...it works fine.

    Can any forum member help me out with this ?

    Thanks a lot !

    C Man

  • #2
    Hello bluenote,

    From Edit Template, Edit Button, how are you entering the function name? Make sure there aren't any function call operators in the name. For example, if the function name you're referencing is main(), only enter main in the text box for the EFS function text box. You could also put some debugPrintln() statements in the funtions your buttons are calling to see if it's working.

    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Thanks !

      Hey Jason !

      Wow....thanks a lot. I didn't know I had to enter the function name from the efs.

      I basically want the button to run the EFS I designated in the Edit Template....Properties.

      I tried "Main" for the button function name....and it seems to work ! I will try it for real once the market opens tomorrow.


      Appreciate your help.


      BlueNote

      Comment


      • #4
        Another Problem

        Hi Jason.....

        I am experimenting with some automated trading with moving average xover code. The labeling of the button as "main" worked originally.

        However I had to add :

        if(getBarState()==BARSTATE_NEWBAR){
        //
        }


        to the "main ()" part of my efs (to have the entry signal at close of bar).

        Note: I tried the 'setComputeOnClose(true)' in the premain instead of the "get bar state" line...but that disables my efs for some reason.

        Now the button doesn't work with this line added. I tried moving the above line around in the body of the main ()....no luck.

        Any suggestions or advice ?

        Thanks a lot for your help.

        BlueNote



        function main() {

        if(getBarState()==BARSTATE_NEWBAR){
        //

        /**
        * The main() function is called once per bar on all previous bars, once per
        * each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
        * in your preMain(), it is also called on every tick.
        */

        // Added.. to check for RT Bar.
        if (getCurrentBarIndex() == 0) {

        //{{EFSWizard_Expressions
        //{{EFSWizard_Expression_1
        if (
        vEMA20.getValue(MAStudy.MA) >= vEMA50.getValue(MAStudy.MA)
        ) onAction1()
        //}}EFSWizard_Expression_1 11980

        //{{EFSWizard_Expression_2
        else if (
        vEMA20.getValue(MAStudy.MA) <= vEMA50.getValue(MAStudy.MA)
        ) onAction2();
        //}}EFSWizard_Expression_2 12163

        //}}EFSWizard_Expressions 44795

        } // end if getCurrentBarIndex() == 0


        //{{EFSWizard_Return
        return new Array(
        vEMA20.getValue(MAStudy.MA),
        vEMA50.getValue(MAStudy.MA)
        );
        //}}EFSWizard_Return 12662

        }
        }

        Comment


        • #5
          Hello BlueNote,

          The function associated with a button will only execute the code when the button is clicked. Your code for main() is for plotting two moving averages. I'm a little confused as to what you are trying to accomplish. What are you expecting to happen when you click your button?
          Jason K.
          Project Manager
          eSignal - an Interactive Data company

          EFS KnowledgeBase
          JavaScript for EFS Video Series
          EFS Beginner Tutorial Series
          EFS Glossary
          Custom EFS Development Policy

          New User Orientation

          Comment


          • #6
            Thanks

            Hi Jason...

            Thanks for your help on this ......


            I'm going to try some workarounds....


            BlueNote

            Comment

            Working...
            X