Announcement

Collapse
No announcement yet.

efsExternal() usage

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

  • efsExternal() usage

    I want to run a master script which will call a number of efs scripts on each bar of data once only and then break when the first script returns a success. However, it seems that each time I call an efs script using efsExternal() the script is run for the whole set of data instead of just the single bar that it has been called from.

    Do I need to specify the exact bar and the symbol when I call the script or is there a way of having the called script run for just the one bar of data that the calling script is referring to?

    PHP Code:
        for (0aList.lengthx++) {
            
    vStrat_result efsExternal(aStrategies[x][script_name],aStrategies[x][open_position],aStrategies[x][price],aStrategies[x][stop_price]);
    //  scripts return array of (open_position, price, stop_price, traded)
            
    for (1;4y++) {
                
    aStrategies[x][y] = getSeries(vStrat_result,y-1);
            }
            if (
    aStrategies[x][1] > 0
                var 
    openStrats.push(x);
    // if script traded the don't run other scripts
            
    if (getSeries(vStrat_result,3) == 1) {
                break;
            } 

  • #2
    ajcryan,

    within an efs, your number of symbols are limited to 7. It sounds like you need to use the eSignal API to accomplish what you are describing.

    Comment


    • #3
      Actually, the script is only running on one symbol.

      Having looked through the forums, I think that maybe efsExternal() will not do what I want it to do. Basically I want to call a script (as I would a routine) to run once on the current bar and return it's results. If successful, then break to the next bar, or if not successful then run the next script on the bar.

      What would be the best way to do this?

      Comment


      • #4
        For a description of the efsExternal() function complete with examples on how to use it see this thread. See also this article in the EFS KnowledgeBase for the syntax required by the function.

        Using efsExternal() will work for you, check out the examples I referenced which will show you how to use this functionality. It sounds as if you have some logic to lay out as well to control execution of your efs. The efs that you are calling will be executed every tick regardless of whether you call it or not so that it will stay in sequence with the efs that you are running as a shell.

        Perhaps you will be just as well off creating functions and running them from the shell you are discussing if you are only talking about running it under the same interval and symbol.

        Comment


        • #5
          Hello ajcryan,

          Another option you might want to explore is the Function Library.
          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 for the suggestions. I wasn't able to get efsInternal to work as I found it was calling the function many times. I changed the code to include the functions within the same script and it worked for me. I have now come to my next problem with the strategy analyser. I will post this on the back testing forum.

            Thanks,

            Comment

            Working...
            X