Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ See the [minutes tutorial](docs/tutorials/minutes.ipynb) for a detailed explanat
| Hamburg Stock Exchange | XHAM | Germany | 4.5.5 | https://www.boerse-hamburg.de |
| Duesseldorf Stock Exchange | XDUS | Germany | 4.5.5 | https://www.boerse-duesseldorf.de |
| Luxembourg Stock Exchange | XLUX | Luxembourg | 4.8 | https://www.luxse.com/ |
| Tallinn Stock Exchange | XTAL | Estonia | 4.11 | https://nasdaqbaltic.com |
| Riga Stock Exchange | XRIS | Latvia | 4.11 | https://nasdaqbaltic.com |
| Vilnius Stock Exchange | XLIT | Lithuania | 4.11 | https://nasdaqbaltic.com |

Expand Down
2 changes: 2 additions & 0 deletions exchange_calendars/calendar_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
from .exchange_calendar_xswx import XSWXExchangeCalendar
from .exchange_calendar_xtae import XTAEExchangeCalendar
from .exchange_calendar_xtai import XTAIExchangeCalendar
from .exchange_calendar_xtal import XTALExchangeCalendar
from .exchange_calendar_xtks import XTKSExchangeCalendar
from .exchange_calendar_xtse import XTSEExchangeCalendar
from .exchange_calendar_xwar import XWARExchangeCalendar
Expand Down Expand Up @@ -123,6 +124,7 @@
"XSWX": XSWXExchangeCalendar,
"XTAE": XTAEExchangeCalendar,
"XTAI": XTAIExchangeCalendar,
"XTAL": XTALExchangeCalendar,
"XTKS": XTKSExchangeCalendar,
"XTSE": XTSEExchangeCalendar,
"XWAR": XWARExchangeCalendar,
Expand Down
78 changes: 78 additions & 0 deletions exchange_calendars/exchange_calendar_xtal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
from datetime import time
from zoneinfo import ZoneInfo

import pandas as pd
from pandas.tseries.holiday import EasterMonday, GoodFriday, Holiday

from .common_holidays import (
ascension_day,
boxing_day,
christmas_eve,
new_years_day,
new_years_eve,
)
from .exchange_calendar import HolidayCalendar, ExchangeCalendar

NewYearsDay = new_years_day()
AscensionDay = ascension_day()
ChristmasEve = christmas_eve()
BoxingDay = boxing_day()
NewYearsEve = new_years_eve()

IndependenceDay = Holiday("Independence Day", month=2, day=24)
SpringDay = Holiday("Spring Day", month=5, day=1)
VictoryDay = Holiday("Victory Day", month=6, day=23)
MidsummerDay = Holiday("Saint John's Day", month=6, day=24)
RestorationOfIndependence = Holiday("Independence Restoration Day", month=8, day=20)


class XTALExchangeCalendar(ExchangeCalendar):
"""
Calendar for the Tallinn Stock Exchange (Estonia).
https://nasdaqbaltic.com/statistics/en/calendar?holidays=1

Open Time: 10:00 AM, EET (Eastern European Time)
Close Time: 4:00 PM, EET (Eastern European Time)

Regularly-Observed Holidays:
- New Year's Day
- Independence Day (Feb 24)
- Good Friday
- Easter Monday
- Spring Day (May 1)
- Ascension Day
- Victory Day (Jun 23)
- Midsummer Day (Jun 24)
- Restoration of Independence (Aug 20)
- Christmas Eve (Dec 24)
- Boxing Day (Dec 26)
- New Year's Eve (Dec 31)
"""

name = "XTAL"
tz = ZoneInfo("Europe/Tallinn")
open_times = ((None, time(10, 0)),)
close_times = ((None, time(16, 0)),)

@property
def regular_holidays(self):
return HolidayCalendar([
NewYearsDay,
IndependenceDay,
GoodFriday,
EasterMonday,
SpringDay,
AscensionDay,
VictoryDay,
MidsummerDay,
RestorationOfIndependence,
ChristmasEve,
BoxingDay,
NewYearsEve,
])

@property
def adhoc_holidays(self):
return [
pd.Timestamp("2023-12-25"), # Additional Day off
]
Loading