Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Does Order Target Percent take into account Early Close or do I need to add code

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

2 responses

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.

Hello Dan
Thank you - that is very helpful.
Much appreciate and a pleasant evening
Savio