Collect EDI data

EDI data can be purchased two ways: a one-time purchase of historical data for 10 exchanges, or a subscription that includes history plus daily updates. A common purchase strategy is to purchase the historical data bundle for research, then, based on the research results, subscribe to daily updates for the exchanges you intend to trade. Explore EDI data in the Data Library.

For each of our 10 exchanges:

In [1]:
exchanges = (
    # MIC, db_name
    ("XBRU", "edi-belgium-1d"),
    ("XTSE", "edi-canada-1d"),
    ("XPAR", "edi-france-1d"),
    ("XETR", "edi-germany-1d"),
    ("XHKG", "edi-hongkong-1d"),
    ("XJPX", "edi-japan-1d"),
    ("XAMS", "edi-netherlands-1d"),
    ("XSTO", "edi-sweden-1d"),
    ("XSWX", "edi-switzerland-1d"),
    ("XLON", "edi-uk-1d")
)

We create a separate database and collect history:

In [2]:
from quantrocket.history import create_edi_db, collect_history, drop_db

for mic, db_name in exchanges:
    create_edi_db(db_name, exchanges=mic)
    collect_history(db_name)

Use flightlog to monitor the progress for each exchange:

quantrocket.history: INFO [edi-belgium-1d] Collecting EDI XBRU history from 2007 to present
quantrocket.history: INFO [edi-belgium-1d] Collecting updated EDI securities listings for XBRU
quantrocket.history: INFO [edi-belgium-1d] Collecting additional EDI XBRU history from 2020-09 to present
quantrocket.history: INFO [edi-belgium-1d] Collected 166 monthly files in quantrocket.v2.history.edi-belgium-1d.sqlite