Hi Everyone
Wondered if you can let me know if order_target_percent(context.stock, 0) at the end of the day takes Early Closes automatically into account or whether additional code needs to be added to allow for this?
Much appreciate
Savio
Hi Everyone
Wondered if you can let me know if order_target_percent(context.stock, 0) at the end of the day takes Early Closes automatically into account or whether additional code needs to be added to allow for this?
Much appreciate
Savio
None of the order methods, including 'order_optimal_portfolio', "take into account" any early market closings. These order methods simply place orders. They don't 'look ahead' to when the market might close. They simply place orders at the time they are scheduled.
All orders on Quantopian are placed as 'day orders' and will be canceled at the end of the day. This is true weather the day is a full or half trading day. At the end of the day all orders are canceled.
So, do you need to add any additional code to account for half days? No, any orders placed while the market is open will work as expected and be canceled at the end of the day, whether full or half.
Note, the schedule functions have a parameter to explicitly state whether to run on half days.
Good luck. Hope that helps.