Skip to content

orchestrator

The brokers whose historical candles can be downloaded, and the three whose cannot.

Seven of the ten brokers serve historical candles. The other three are recorded here with the reason rather than being silently absent, because "why is Kotak not backfilling" is a question that will otherwise be asked more than once.

Functions:

Name Description
downloader_for

The candle downloader class for a broker.

downloader_for

downloader_for(broker_name)

The candle downloader class for a broker.

  • broker_name is the name of the broker.
Source code in stock_brokers/instruments/historical/utilities/orchestrator.py
def downloader_for(broker_name):
    """
    The candle downloader class for a broker.

    - `broker_name` is the name of the broker.
    """
    if broker_name in UNSUPPORTED:
        raise ValueError(f"{broker_name} has no historical candles: {UNSUPPORTED[broker_name]}")
    if broker_name not in DOWNLOADERS:
        raise ValueError(f"No candle downloader for {broker_name}. "
                         f"Known: {', '.join(sorted(DOWNLOADERS))}")
    module_name, class_name = DOWNLOADERS[broker_name]
    return getattr(importlib.import_module(module_name), class_name)