Skip to content

quantpylib.datapoller.currencies

Currencies

Bases: BasePoller

get_ticker_metadata(ticker, **kwargs)

Retrieve metadata for a specific currency. @poller

Parameters:

Name Type Description Default
ticker str

Currency ticker symbol.

required
**kwargs

Data-source specific keyword arguments for endpoint specification.

{}

Returns:

Type Description

Metadata for the specified currency from the selected data source.

get_trade_bars(**kwargs) async

Retrieve OHLCV trade bar data for currencies. @ts_poller

Parameters:

Name Type Description Default
**kwargs

Data-source specific keyword arguments for endpoint specification.

{}

Returns:

Type Description

Trade bar data for the specified currency from the selected data source.

Examples:

>>> df=datapoller.currencies.get_trade_bars(ticker="EUR_USD",start=start,end=end,granularity="d",src="oanda")
>>> df=datapoller.currencies.get_trade_bars(ticker="EUR_USD",granularity="h",granularity_multiplier=4,start=start,end=end,src="oanda")

l1_book_subscribe(ticker, handler, **kwargs) async

Stream market data for a specific currency. @poller(tag="stream")

Parameters:

Name Type Description Default
ticker str

Currency ticker symbol.

required
handler coroutine

A coroutine handler for the message received.

required
**kwargs

Data-source specific keyword arguments for endpoint specification.

{}

Returns:

Type Description

Streaming market data for the specified currency from the selected data source.

Examples:

>>> async def handler(msg): 
        print(msg)
>>> await datapoller.currencies.l1_book_subscribe(ticker="EURUSD",src="eodhd",handler=handler)

l1_book_unsubscribe(ticker, **kwargs) async

Terminate streaming for market data of a specific currency. @poller(tag="stream")

Parameters:

Name Type Description Default
ticker str

Currency ticker symbol.

required
**kwargs

Data-source specific keyword arguments for endpoint specification.

{}

l2_book_subscribe(ticker, handler, **kwargs) async

Stream market data for a specific currency. @poller(tag="stream")

Parameters:

Name Type Description Default
ticker str

Currency ticker symbol.

required
handler coroutine

A coroutine handler for the message received.

required
**kwargs

Data-source specific keyword arguments for endpoint specification.

{}

Returns:

Type Description

Streaming market data for the specified currency from the selected data source.

Examples:

>>> async def handler(msg): 
        print(msg)
>>> await datapoller.currencies.l2_book_subscribe(ticker="EURUSD",src="eodhd",handler=handler)

l2_book_unsubscribe(ticker, **kwargs) async

Terminate streaming for market data of a specific currency. @poller(tag="stream")

Parameters:

Name Type Description Default
ticker str

Currency ticker symbol.

required
**kwargs

Data-source specific keyword arguments for endpoint specification.

{}