rsheftel / pandas_market_calendars

Exchange calendars to use with pandas for trading applications
MIT License
804 stars 173 forks source link

Pre and Post schedule for EUREX #184

Open Timescaper opened 2 years ago

Timescaper commented 2 years ago
import pandas_market_calendars as mcal
eurex = mcal.get_calendar('EUREX')
print(eurex.regular_market_times)

Out: _ProtectedDict({'market_open': ((None, datetime.time(9, 0)),), 'market_close': ((None, datetime.time(17, 30)),)}) Eurex has pre and post sessions, pre is start 12:15am UTC and end 8am UTC and post is start 4:30pm and end 9pm UTC. Would you be able to add this in?

glossner commented 2 years ago

@Timescaper here is an example from exchange_calendar_nyse.py

regular_market_times = {
        "pre": ((None, time(4)),),
        "market_open": ((None, time(10)),
                        ("1985-01-01", time(9, 30))),
        "market_close":((None, time(15)),
                        ("1952-09-29", time(15, 30)),
                        ("1974-01-01", time(16))),
        "post": ((None, time(20)),)
    }

Note that if you send in a date (e.g. 1985-01-01) it means that 9:30 open ended and the opening time is now 10am.

I'd be happy to welcome a pull request with this update. Otherwise, I'll keep the Issue open and get to it after the CME calendar updates.