I have a strategy in which I enter short positions using EnterShortLimit and exit those positions using ExitShortLimit. Once the very first short position is taken in the chart while back testing it using daily data, I found that it doesn't exit the short position at the appropriate bar, and instead exits the position after another couple of bars more. In the remaining short trades, it does seem to exit at the appropriate bar.
On debugging with Print, I found that, the ExitShortLimit function does get executed in the appropriate bar. On printing the Error value, it gives NoError. But there is no action (i.e., the short position doesn't get exited). In all the remaining bars, the same thing happens, and after a few more bars, the position finally does get exited. I am not sure how to correct this problem. Can you please let me know what can be the problem.
Comment