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?
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?
Comment