---
title: "Trading Calendar"
description: "The TradingCalendar contains a variety of events relevant to the assets in your algorithm. We source the event data from Quantlib."
canonical: https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/trading-calendar
markdown: https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/trading-calendar.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/03%20Writing%20Algorithms/22%20Trading%20and%20Orders/13%20Trading%20Calendar
modified: 2026-10-30
index: https://www.quantconnect.com/llms.txt
---

# Trading Calendar

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Writing Algorithms](https://www.quantconnect.com/docs/v2/writing-algorithms.md) > Trading and Orders > Trading Calendar

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

## Introduction

The `trading_calendar` contains a variety of events relevant to the assets in your algorithm.

## Trading Day Properties

`TradingDay` objects represent the trading events of a single day. They have the following properties:

*Members of `QuantConnect.TradingDay` (JSON): https://www.quantconnect.com/services/inspector?type=T:QuantConnect.TradingDay&language=python*

## Get a Single Trading Day

To get the trading events of the current day, call the `get_trading_day` method with no arguments.

```python
trading_day = self.trading_calendar.get_trading_day()
```

To get the trading events of a specific day, pass a `datetime` object to the `get_trading_day` method.

```python
trading_day = self.trading_calendar.get_trading_day(datetime(2022, 6, 1))
```

## Get Trading Days

To get all the trading events across a range of dates, pass start and end `datetime` objects to the `get_trading_days` method.

```python
start_date = datetime(2022, 6, 1)
end_date = datetime(2022, 7, 1)
trading_days = self.trading_calendar.get_trading_days(start_date, end_date)
```

To get specific trading events across a range of dates, pass a `TradingDayType` enumeration member and the dates to the `get_days_by_type` method.

```python
trading_days = self.trading_calendar.get_days_by_type(TradingDayType.OPTION_EXPIRATION, start_date, end_date)
```

The `TradingDayType` enumeration has the following members:

*Members of `QuantConnect.TradingDayType` (JSON): https://www.quantconnect.com/services/inspector?type=T:QuantConnect.TradingDayType&language=python*
