Skip to main content

adona-market-data

A thin Python client for the adona-robot market-data API. It covers 46 FX pairs and 5 metals (gold against the dollar and the euro, silver, platinum, palladium), with OHLC candles from one second to one day by REST, and the live bid, ask and closing bars on one WebSocket.

pip install adona-market-data              # candles by REST
pip install "adona-market-data[pandas]"    # + to_pandas()
pip install "adona-market-data[stream]"    # + the live stream
pip install "adona-market-data[all]"
pip install "adona-market-data[backtrader]"   # + a backtrader data feed
pip install "adona-market-data[vectorbt]"     # + a vectorbt Data class

No data ships with this package. Everything is read from the API with your key, and every page you read is billed in slices of 1 000 bars from your plan.

History

from adona_market_data import Client

client = Client()  # the API key from ADONA_API_KEY; keep it on a server
bars = client.candles("EURUSD", "M1", bars=1440)  # the last 1 440 one-minute bars, oldest first
frame = client.to_pandas(bars)  # a DataFrame indexed by time (UTC): open, high, low, close, volume
  • Timeframes are S1, M1, M5, M15, H1, H4 and D1.
  • client.candles(..., since=datetime(...)) reads back to an instant.
  • client.iter_pages(...) yields the pages one by one, newest first, if you want to stop early.

Prices arrive as strings and become Decimal, so no digit is rounded. to_pandas() gives floats, or pass decimals=True to keep them exact.

A candle's volume is a tick volume: the number of price updates received in the bar, not a traded volume.

Live

import asyncio
from adona_market_data import Bar, Client, Quote

async def main():
    client = Client()
    async for event in client.stream(["quote:XAUUSD", "candle:XAUUSD:M1"]):
        if isinstance(event, Quote):
            print(event.symbol, event.bid, event.ask)
        elif isinstance(event, Bar) and not event.snapshot:
            print(event.channel, event.candle.time, event.candle.close)

asyncio.run(main())

The stream reconnects through deploys and network loss with a backoff. It raises StreamStopped on the closes that reconnecting cannot change: an ended trial, a key cut off, a connection limit.

Each (re)subscribe sends the candle channels' recent bars again (snapshot=True), and those bars are billed like a REST page.

Backtesting

The data is read once, when the feed is built.

import backtrader as bt
from adona_market_data import Client
from adona_market_data.backtrader import feed

cerebro = bt.Cerebro()
cerebro.adddata(feed(Client(), "EURUSD", "M5", bars=5000), name="EURUSD")
import vectorbt as vbt
from adona_market_data import Client
from adona_market_data.vectorbt import AdonaData

data = AdonaData.download(["EURUSD", "GBPUSD"], client=Client(), timeframe="M15", bars=3000)
close = data.get("Close")

The vectorbt class needs Python 3.11 or later. The volume in both is the tick volume. The archive is recent (see the depth below), so these are for strategies tested on recent months.

The connectors read through the API with your key, page by page, billed like any other page and within your plan's quota. Nothing is downloaded in bulk, and the terms of service apply.

Refusals

Every refusal is a Refused with the API's code, for example CUSTOMER_MINUTE_CEILING or SYMBOL_NOT_ALLOWED. It also carries the HTTP status, the fields of a validation error and Retry-After.

The client retries only what waiting can clear:

  • the network;
  • the server's own errors;
  • a 429 other than the daily guard, honouring Retry-After.

A retired token is replaced once. refused.is_answer tells you when retrying the same call is pointless. Every code is listed, with what to do, in the API reference.

What it is, and what it is not

  • The depth. One-minute bars and above go back to May 2025 for EURUSD, GBPUSD, USDJPY and XAUUSD, and to spring 2026 for the others. One-second bars are kept 180 days rolling. Each symbol's own dates are on its page, https://adona-robot.com/en/symbols. That suits a chart or a model on recent months, not a backtest over many years.
  • Where the key goes. The API key stays on a server. A browser gets a short-lived token from your server instead: see the quickstart.
  • Trial and plans. The free trial lasts 7 days, on EURUSD and XAUUSD. Plans are on https://adona-robot.com/en.

Development

uv venv && uv pip install -e ".[all,backtrader,vectorbt]" pytest pytest-asyncio responses
.venv/bin/python -m pytest

The tests run against recorded answers and a local WebSocket server. None of them calls the API.

MIT licence for this code. The data you read through it is governed by the terms of service.

Metadata

Release files for adona-market-data 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adona-market-data 0.2.0
File Size Uploaded Provenance Actions
adona_market_data-0.2.0.tar.gz 17.4 kB With provenance Details for adona_market_data-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for adona-market-data 0.2.0
File Interpreter ABI Platform Actions
adona_market_data-0.2.0-py3-none-any.whl Python 3 none any Details for adona_market_data-0.2.0-py3-none-any.whl

Total release size: 34.4 kB

Release files / adona_market_data-0.2.0.tar.gz

Download URL adona_market_data-0.2.0.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
06c5735027246c39329656b5565301498126fc0148099a50a9f95edf5b05d6b0
BLAKE2b-256 checksum
How to use checksums
b28e5b84f216006684c7608687b0f43476bbbd6ce4e9b7741a79c43d503a6abf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / adona_market_data-0.2.0-py3-none-any.whl

Download URL adona_market_data-0.2.0-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6206e712bb7673eee74f38f57cc37e61ec56415f3df4e92673d90b2339c5be8a
BLAKE2b-256 checksum
How to use checksums
2805981aa75a90b7dbc5c623005f4007a803aaa17aa4fc9df7976b7aed3aaaf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Security for adona-market-data 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for adona_market_data-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page