Columbus Day 2023 markets are open, for the expiry date of Oct 9, 2023. How are the holidays maintained? Any workarounds?
Trying to find the last mkt day before the expiration date for options. Running the below code with expiry of Oct 9,2023 is returning Oct 6,2023, expecting Oct 9,2023.
tradingCalendar = self.TradingCalendar
list(tradingCalendar.GetDaysByType(TradingDayType.BusinessDay, expiry - timedelta(days = 20), expiry))[-1].Date
Mia Alissi
The
TradingCalendar
in QuantConnect provides a variety of events relevant to the assets in your algorithm. It sources the event data from Quantlib. TheGetDaysByType
method can be used to get specific trading events across a range of dates. In your case, you are using it to get business days between a certain range.However, it seems like you are experiencing an issue with Columbus Day 2023. This might be due to how holidays are maintained in the
TradingCalendar
.Unfortunately, the provided extracts do not contain specific information on how holidays like Columbus Day are handled in the
TradingCalendar
. Therefore, I can't provide a confident answer or workaround for your issue based on the provided extracts.I would recommend checking the official QuantConnect documentation or reaching out to the QuantConnect community for more specific guidance on this issue.
Here is the link to the
TradingCalendar
documentation for your reference: Trading CalendarThe material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Ram Panguluri
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!