-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
(feat) add BTC Markets spot candles feed implementation #7670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
(feat) add BTC Markets spot candles feed implementation #7670
Conversation
- Implement BtcMarketsSpotCandles class extending CandlesBase - Add REST API integration for historical candle data fetching - Support all standard timeframes (1m to 1M) with proper mapping - Handle ISO 8601 timestamp conversion for BTC Markets API - Include proper rate limiting and error handling - Add constants file with API endpoints and rate limits This implementation provides historical candle data for BTC Markets exchange following the Hummingbot candles feed architecture. Note: WebSocket is not supported as BTC Markets doesn't provide real-time candle streaming via WebSocket.
a36de11
to
0c0b4d5
Compare
hi @jrcalzada-nginio cc: @jreniel |
Hi @nikspz, |
@nikspz Let's try to get this PR merged into v2.8 release since it's been approved via governance. |
commit 0558df4 @jrcalzada-nginio cc: @jreniel When starting download script using btc_markets Bot flooded with error: 7670candlesbtcmarkets.zip tried different intervals, same issue, but binance works well (see .zip above) :
|
Hi @nikspz, Thank you for your feedback. At the current moment, BTC Markets does not support WebSocket candlestick data. The error is caused by Our current BTC Markets implementation works well for backtesting scenarios using REST API calls. Before implementing a solution, I'd appreciate your input on a few questions: What's your intended use case - backtesting historical data, or live candle updates for trading strategies? If you need live updates, would a polling-based approach be acceptable for your needs? This would help determine whether we should focus on simply preventing the WebSocket errors for backtesting scenarios, or if we need to implement an alternative mechanism. What are your thoughts on the best approach for this scenario? Thanks! |
You proposed this PR, and it's your responsibility to conform to the
candles standard. Check the other connector candles for how they are used
in backtesting in Hummingbot API.
…On Fri, Jul 18, 2025, 10:14 AM Jaime R Calzada ***@***.***> wrote:
*jrcalzada-nginio* left a comment (hummingbot/hummingbot#7670)
<#7670 (comment)>
Hi @nikspz <https://github.com/nikspz>,
Thank you for your feedback. At the current moment, BTC Markets does not
support WebSocket candlestick data. The error is caused by WSS_URL = None
in our constants file
<https://github.com/hummingbot/hummingbot/blob/0558df45f9bcf6c3617bcd58e7e2b6b38db66844/hummingbot/data_feed/candles_feed/btc_markets_spot_candles/constants.py#L9>,
which causes the TypeError when the system attempts to establish WebSocket
connections.
Our current BTC Markets implementation works well for backtesting
scenarios using REST API calls.
Before implementing a solution, I'd appreciate your input on a few
questions: What's your intended use case - backtesting historical data, or
live candle updates for trading strategies? If you need live updates, would
a polling-based approach be acceptable for your needs?
This would help determine whether we should focus on simply preventing the
WebSocket errors for backtesting scenarios, or if we need to implement an
alternative mechanism.
What are your thoughts on the best approach for this scenario?
Thanks!
—
Reply to this email directly, view it on GitHub
<#7670 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANWHVVZFOCPIIY7MMKD2WT3JETONAVCNFSM6AAAAAB7RAA3WSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAOJQGEZTKMZWGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
…ebSocket (not supported).
BTC Markets Candles ImplementationProblem: BTC Markets doesn't support WebSocket for candles, causing Solution: Implemented constant polling approach that conforms to Hummingbot's candles standard:
This approach works for both backtesting (complete historical data) and live trading (real-time updates), matching how other REST-only exchanges handle candles in the Hummingbot ecosystem. The implementation maintains the standard candle format and interface while working within BTC Markets' API constraints. @nikspz Could you please test the updated implementation when you have a chance? The TypeError issues you encountered should now be resolved. Please let me know if you run into any other issues! |
…chitecture Replace infinite while loop in listen_for_subscriptions() with cancellable asyncio task. Add graceful shutdown mechanisms and separate polling logic into testable components. Add tests that verify actual polling logic and task lifecycle management. Eliminates need for complex test mocking while maintaining identical polling behavior.
Hi @nikspz, |
Could you add test coverage? |
@nikspz I will take care of the missing test coverage and will tag you again once I have completed that. Thanks again for reviewing my submission! |
This implementation provides historical candle data for BTC Markets exchange following the Hummingbot candles feed architecture. Note: WebSocket is not supported as BTC Markets doesn't provide real-time candle streaming via WebSocket.