When I review the back-testing results, I find that the orders are always been filled in the next trading day. This may effect the performance of the trading strategy.
For example, the trading signal tells that the portfolio should be re-balanced on 2003/1/6. By "History" function, I am able to get all the data on and before 2003/1/6. Also, I calculate the trading amount of each securities based on that. However, the back-testing results shows that the order is made on 1/6, but filled on 1/7, at the price on 1/7. So, my confusion is all the trading amount is calculated on 1/6, but the transaction is actually made on the next trading day. I wonder if it is possible to make orders be filled in the same day in zipline, or there is another way to fix this problem.
In addition, there is a optional parameter "instant_fill" in class "TradingAlgorithm", which is to determine whether to fill orders immediately or on next bar. The default value is False. However, I don't find the declaration and any usage of this parameter. I wonder if this parameter is no longer used in Zipline, and if there is another similar parameter to use.
I really appreciate your opinions on the issue. Thank you!