Announcement

Collapse
No announcement yet.

efsInternal - question

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

  • efsInternal - question

    Okay, maybe what I'm trying to do is beyond the scope of what efsInternal can do because I just can't get it to seem to work properly. I've read about 50 threads on efsInternal/external and can't find an answer so here is my deal:

    When I first saw the efsInternal/external functionality and understood it to be a way to cause a function to iterate across all bars on the current (or any) chart, I thought it could be a great way to create an optomize routine for a strategy. Basically, you could use efsInternal/external to call your strategy repeatedly with different parameter values and track the performance of each - thus finding the best set of parameters to use for a particular strategy/instrument.

    Is this not really possilble because it doesn't seem to be working the way I expected. First I tried putting the efsInternal call in a function linked to a button but it appeared to not do anything so I moved it to some conditional logic in my main() function. That appears to at least get into the routine but it still doesn't seem to be working completely. It seems like the script is just stopping execution somewhere in the efsInternal call with no error. I think this because debugPrintln statements immediately after the efsInternal call never get executed.

    Calling a simple function that just outputs the current bar index seems to work fine - producing each bar index in the output window. However, when I try to call my "real" function (the one that implements the strategy) it goes goofy and doesn't appear to work at all. One thing I notice immediately is all my calls to the strategy functions (doLong, etc.) fail - returning false on every one. Is that the root of the problem? Are there restrictions on what things can be done in the context of an efsInternal called function?

  • #2
    Hello ebr,

    The way you are trying to use the function is beyond the purpose of the function. It simply creates a series object based on the return values generated by the called function, or formula in the case of efsExternal(). The return value(s) must be numbers. It cannot use stings or boolean returns. Any other operations that you try to execute within the called function such as Strategy calls etc. will be ignored.
    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 for the reply. I had figured out that my purpose is beyond the scope of the efsInternal function. However, I'd like to point out that statements like the strategy calls are not ignored. Instead it tries to execute them and, when they fail, the execution of the entire script stops with no error. Even if you are in a loop, it breaks out of that loop and nothing else is executed.

      I figured this out with a bunch of debug statements and trial and error. It gets right up to one of those calls and then just stops - nothing after the call is executed. It would be nice if some sort of error were thrown somewhere to let one know there is a problem.

      Also, it might be a good idea to explain some of these limitations in the description of the efsInternal/external functions.

      Comment

      Working...
      X