| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
BeQuant exchange plugin for bt_api — Unified REST and WebSocket API for Spot trading and more.
bt_api_bequant is a runtime plugin for bt_api that connects to BeQuant exchange. It depends on bt_api_base for core infrastructure.
| Resource | Link |
|---|---|
| English Docs | https://bt-api-bequant.readthedocs.io/ |
| Chinese Docs | https://bt-api-bequant.readthedocs.io/zh/latest/ |
| GitHub | https://github.com/cloudQuant/bt_api_bequant |
| PyPI | https://pypi.org/project/bt_api_bequant/ |
| Issues | https://github.com/cloudQuant/bt_api_bequant/issues |
| bt_api_base | https://bt-api-base.readthedocs.io/ |
| Main Project | https://github.com/cloudQuant/bt_api_py |
| Asset Type | Code | REST | WebSocket | Description |
|---|---|---|---|---|
| Spot | BEQUANT___SPOT | ✅ | ✅ | Spot trading |
Auto-registers at import time via ExchangeRegistry. Works seamlessly with BtApi:
from bt_api_py import BtApi
api = BtApi(exchange_kwargs={
"BEQUANT___SPOT": {
"api_key": "your_key",
"secret": "your_secret",
}
})
ticker = api.get_tick("BEQUANT___SPOT", "BTCUSDT")
balance = api.get_balance("BEQUANT___SPOT")
order = api.make_order(exchange_name="BEQUANT___SPOT", symbol="BTCUSDT", volume=0.001, price=50000, order_type="limit")All exchange responses normalized to bt_api_base container types:
pip install bt_api_bequantgit clone https://github.com/cloudQuant/bt_api_bequant
cd bt_api_bequant
pip install -e .pip install bt_api_bequantfrom bt_api_py import BtApi
api = BtApi()
ticker = api.get_tick("BEQUANT___SPOT", "BTCUSDT")
print(f"BTCUSDT price: {ticker.price}")from bt_api_py import BtApi
api = BtApi(exchange_kwargs={
"BEQUANT___SPOT": {
"api_key": "your_api_key",
"secret": "your_secret",
}
})
order = api.make_order(
exchange_name="BEQUANT___SPOT",
symbol="BTCUSDT",
volume=0.001,
price=50000,
order_type="limit",
)
print(f"Order placed: {order.id}")from bt_api_py import BtApi
api = BtApi(exchange_kwargs={
"BEQUANT___SPOT": {"api_key": "key", "secret": "secret"}
})
# REST calls
ticker = api.get_tick("BEQUANT___SPOT", "BTCUSDT")
balance = api.get_balance("BEQUANT___SPOT")
# WebSocket subscription
api.subscribe("BEQUANT___SPOT___BTCUSDT", [
{"topic": "ticker", "symbol": "BTCUSDT"},
{"topic": "depth", "symbol": "BTCUSDT", "depth": 20},
])
queue = api.get_data_queue("BEQUANT___SPOT")
msg = queue.get(timeout=10)bt_api_bequant/
├── plugin.py # register_plugin() — bt_api plugin entry point
├── registry_registration.py # register_bequant() — feeds / exchange_data registration
├── exchange_data/
│ └── bequant_exchange_data.py # BeQuantExchangeData
├── feeds/
│ ├── live_bequant/
│ │ ├── spot.py # BeQuantRequestDataSpot
│ │ └── request_base.py # RequestData base class
├── containers/ # Normalized data container types
├── gateway/
│ └── adapter.py # BeQuantGatewayAdapter
└── errors/
└── bequant_translator.py # BeQuantErrorTranslator → bt_api_base.ApiError
| Category | Operation | Notes |
|---|---|---|
| Market Data | get_ticker | 24hr rolling ticker |
| get_orderbook | Order book depth | |
| get_bars | K-line/candlestick | |
| get_trades | Recent trade history | |
| Account | get_balance | All asset balances |
| get_position | Positions | |
| get_open_orders | All open orders | |
| get_order | Single order by ID | |
| Trading | make_order | LIMIT/MARKET orders |
| cancel_order | Cancel order | |
| WebSocket | subscribe_symbols | Market data streams |
| poll_output | Blocking/non-blocking output poll |
All BeQuant API errors are translated to bt_api_base ApiError subclasses.
| Doc | Link |
|---|---|
| English | https://bt-api-bequant.readthedocs.io/ |
| 中文 | https://bt-api-bequant.readthedocs.io/zh/latest/ |
| bt_api_base | https://bt-api-base.readthedocs.io/ |
| Main Project | https://cloudquant.github.io/bt_api_py/ |
MIT — see LICENSE.
bt_api 的 BeQuant 交易所插件 — 为现货交易等提供统一的 REST 和 WebSocket API。
bt_api_bequant 是 bt_api 的运行时插件,连接 BeQuant 交易所。依赖 bt_api_base 提供核心基础设施。
| 资产类型 | 代码 | REST | WebSocket | 说明 |
|---|---|---|---|---|
| 现货 | BEQUANT___SPOT | ✅ | ✅ | 现货交易 |
通过 ExchangeRegistry 在导入时自动注册,与 BtApi 无缝协作:
from bt_api_py import BtApi
api = BtApi(exchange_kwargs={
"BEQUANT___SPOT": {
"api_key": "your_key",
"secret": "your_secret",
}
})
ticker = api.get_tick("BEQUANT___SPOT", "BTCUSDT")
balance = api.get_balance("BEQUANT___SPOT")
order = api.make_order(exchange_name="BEQUANT___SPOT", symbol="BTCUSDT", volume=0.001, price=50000, order_type="limit")所有交易所响应规范化为 bt_api_base 容器类型:
pip install bt_api_bequantgit clone https://github.com/cloudQuant/bt_api_bequant
cd bt_api_bequant
pip install -e .pip install bt_api_bequantfrom bt_api_py import BtApi
api = BtApi()
ticker = api.get_tick("BEQUANT___SPOT", "BTCUSDT")
print(f"BTCUSDT 价格: {ticker.price}")from bt_api_py import BtApi
api = BtApi(exchange_kwargs={
"BEQUANT___SPOT": {
"api_key": "your_api_key",
"secret": "your_secret",
}
})
order = api.make_order(
exchange_name="BEQUANT___SPOT",
symbol="BTCUSDT",
volume=0.001,
price=50000,
order_type="limit",
)
print(f"订单已下单: {order.id}")from bt_api_py import BtApi
api = BtApi(exchange_kwargs={
"BEQUANT___SPOT": {"api_key": "key", "secret": "secret"}
})
# REST 调用
ticker = api.get_tick("BEQUANT___SPOT", "BTCUSDT")
balance = api.get_balance("BEQUANT___SPOT")
# WebSocket 订阅
api.subscribe("BEQUANT___SPOT___BTCUSDT", [
{"topic": "ticker", "symbol": "BTCUSDT"},
{"topic": "depth", "symbol": "BTCUSDT", "depth": 20},
])
queue = api.get_data_queue("BEQUANT___SPOT")
msg = queue.get(timeout=10)bt_api_bequant/
├── plugin.py # register_plugin() — bt_api 插件入口
├── registry_registration.py # register_bequant() — feeds / exchange_data 注册
├── exchange_data/
│ └── bequant_exchange_data.py # BeQuantExchangeData
├── feeds/
│ ├── live_bequant/
│ │ ├── spot.py # BeQuantRequestDataSpot
│ │ └── request_base.py # RequestData 基类
├── containers/ # 规范化数据容器类型
├── gateway/
│ └── adapter.py # BeQuantGatewayAdapter
└── errors/
└── bequant_translator.py # BeQuantErrorTranslator → bt_api_base.ApiError
| 类别 | 操作 | 说明 |
|---|---|---|
| 行情数据 | get_ticker | 24小时滚动行情 |
| get_orderbook | 订单簿深度 | |
| get_bars | K线/蜡烛图 | |
| get_trades | 近期成交历史 | |
| 账户 | get_balance | 所有资产余额 |
| get_position | 持仓 | |
| get_open_orders | 所有挂单 | |
| get_order | 按ID查询单笔订单 | |
| 交易 | make_order | 限价/市价订单 |
| cancel_order | 撤销订单 | |
| WebSocket | subscribe_symbols | 行情数据流订阅 |
| poll_output | 阻塞/非阻塞输出轮询 |
所有 BeQuant API 错误均翻译为 bt_api_base ApiError 子类。
| 文档 | 链接 |
|---|---|
| 英文文档 | https://bt-api-bequant.readthedocs.io/ |
| 中文文档 | https://bt-api-bequant.readthedocs.io/zh/latest/ |
| bt_api_base | https://bt-api-base.readthedocs.io/ |
| 主项目 | https://cloudquant.github.io/bt_api_py/ |
MIT — 详见 LICENSE。
| Back | FazBrowse Home | New Git URL |