Skip to main content

Accessing Data from a Live Trading Environment

This guide addresses how to use CloudQuant Data Liberator data in live algorithmic trading environments, particularly when third-party APIs cannot be integrated directly.

Key Challenges

Some organizations restrict third-party APIs in live trading systems. In such cases, data must be retrieved locally and transferred through approved methods to the trading server.

Data Transfer Solutions

Low Frequency Approaches

For infrequently updated data, organizations can establish shared file storage accessible to both the live trading application and local servers. Data can be pushed to these locations on a scheduled basis. Coordination with the Operations department is necessary to arrange access.

High Frequency Solutions

For more frequent intraday updates, messaging services like ZeroMQ are recommended as lightweight alternatives. ZeroMQ operates peer-to-peer without requiring intermediate broker infrastructure.

Accessing Live Data from CloudQuant Data Liberator

CloudQuant Data Liberator delivers live datasets with similar simplicity to historical data retrieval. The platform supports seamless transitions between historical and real-time data.

Example Code

import liberator

liberator.url = 'https://weather.cloudquant.ai/'

yesterday = '2024-08-01'

res = liberator.query(name = 'us_live_weather', symbols = '78758', as_of = 'live', back_to = yesterday)

for batch in res:
    df = batch.to_pandas()
    print(df)
When back_to is specified, the query delivers historical data from that point forward, then automatically transitions to live streaming. Omitting back_to initiates live data immediately at the vendor’s defined frequency.