I have a somewhat complicated efs strategy that I use for backtesting. I've been having some problems with it behaving erratically (totally skipping some trading days).
I finally chased down the issue to what appears to be the function call to Strategy.isShort() returning "true" when, in fact, there is no open trade. This is causing my logic to go haywire.
I've done extensive debugging and am 99% sure this is an erroneous return value (leaving that 1% chance that somehow I'm missing something). I come to this conclusion because the strategy analysis report reports clean trades before and after this time in the script. If I really did have a position hanging out there the next entry/exit would reflect it by either closing the erroneous position (if the next entry were opposite) or reporting an increased size upon closing of the next position (if the next entry were in the same direction.
Has anyone else encountered a bug where these funtions (isShort or isLong) will return incorrect values? Its wreaking all kinds of havoc with my backtesting attempts and making it pretty much impossible for me to trust anything I'm getting from the strategy analyzer. I've searched out here and haven't found any reference to this.
Thanks anyone who can help.
I finally chased down the issue to what appears to be the function call to Strategy.isShort() returning "true" when, in fact, there is no open trade. This is causing my logic to go haywire.
I've done extensive debugging and am 99% sure this is an erroneous return value (leaving that 1% chance that somehow I'm missing something). I come to this conclusion because the strategy analysis report reports clean trades before and after this time in the script. If I really did have a position hanging out there the next entry/exit would reflect it by either closing the erroneous position (if the next entry were opposite) or reporting an increased size upon closing of the next position (if the next entry were in the same direction.
Has anyone else encountered a bug where these funtions (isShort or isLong) will return incorrect values? Its wreaking all kinds of havoc with my backtesting attempts and making it pretty much impossible for me to trust anything I'm getting from the strategy analyzer. I've searched out here and haven't found any reference to this.
Thanks anyone who can help.
Comment