Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Is a trading calendar available in the algorithm?

Hi,

I want to check if tomorrow is a trading holiday. Is there anyway to do this in quantopian?

Best regards,
Pravin

2 responses

I saw this code in Research once:

In [2]: from zipline.utils.tradingcalendar import trading_day  
In [3]: from pandas import date_range  
In [4]: days = date_range('2010-01-01', '2015-01-01', freq=trading_day)  
In [5]: len(days)  
Out[5]: 1258  

Maybe try and see if you can import trading_day in an Algorithm and if dates in the future work too.

Thanks Luca. I will get that a try.