I noticed some unexpected behavior in my strategy.
It happens when in my strategy a order to buy/sell is generated on the last bar of the trading day. The trade is blocked by a ToTime(Time[0])< ...... timefilter in the same Enterlong/short statement (I don't enter new trades in the last half hour of the day).
Now, when the next day starts, the trade of the previous day is executed on the close of the first bar of that day.
It seems the trade of the previous day, which was blocked by the timefilter, was kept in some memory and executed when possible, being the next trading day.
Is there any way to clear this 'memory' on the end of the day or beginning of the next day?
Thanks!
Comment