Announcement

Collapse
No announcement yet.

Removing efsExternal() or call() instance ...

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

  • Removing efsExternal() or call() instance ...

    Hi There:

    I am wondering if there is a way to get eSignal to stop calling to an external EFS after being called.

    In my "calling" script, I call to an external efs script using this code:


    var Count = 0;
    var Test = null;

    function main() {

    switch (Count) {

    case 0:

    Test = efsExternal("Scriptname.efs");
    Count++;

    break;

    case 1:

    Test = null;

    break;


    }

    return Count;

    }

    And in the other script I put in a simple "debugPrintln("Running ..."); within the main() function. Here is the code:

    function main() {

    debugPrintln("Running ...");

    }


    What I want to do is when the Count variable is equal to 1, to stop the efsExternal() from running. This is very important to me because I have a single script that is called to handle getting out of a trade that may be called 40 times a day with different variables passed to it. However when I'm done with calling the script I want the called script (external one) to stop running.

    Sorry if this sounds confusing ... my programming knowledge is self taught so there will be many things that might look odd to a trained programmer.

    Thanks,

    Corey

  • #2
    Any ideas on this? After calling the efsExternal() function I just want to be able to kill it to avoid memory leaks.

    Is there a way to call it as a new object and then maybe use the delete command to delete the object?

    Any help would be appreciated. It may seem like an odd request but when I have 10 trading strategies use the same type of exiting logic by calling the same script. That way if I change the exiting script it would affect all 10 strategies simultaneously.

    Thanks,

    Corey

    Comment


    • #3
      What I want to do is when the Count variable is equal to 1, to stop the efsExternal() from running.
      I have no idea if this will do what you want but consider adding an if condition to the "Test = ..." line.

      Since you want it to execute only once and variables "Test" and "Count" are globals, maybe something like:

      PHP Code:
      if (Count == 0Test efsExternal("Scriptname.efs"); 
      or
      PHP Code:
      if( Test == null )  Test efsExternal("Scriptname.efs"); 
      If some other conditional needs an update from efsExternal just reset the variable "Count" or "Test" as appropriate within the conditional and before the efsExternal call.

      Also a forum search for something like "call()", "callFunction()", "efsExternal()" might produce something useful.

      Wayne
      Last edited by waynecd; 12-06-2012, 03:30 PM.

      Comment

      Working...
      X