大富翁交易客户端
trade-client是大富翁量化框架中用来交易的客户端。它对回测和实盘提供了几乎相同的接口,从而使得经过回测的策略,可以无缝切换到实盘环境中。
功能
- 进行实盘和回测交易
- 获取账号基本信息,比如本金、资产、持仓、盈亏及盈亏比等。
- 交易函数,比如买入(限价和市价)、卖出(限价和市价)、撤单等
- 查询委托、成交、持仓(当日和指定日期)
- 查询一段时间内的账户评估指标,比如sharpe, sortino, calmar, voliality, win rate, max drawdown等。
- 查询参照标的同期指标。
!!!Warning
在回测模式下,注意可能引起账户数据改变的操作,比如buy、sell等,必须严格按时间顺序执行,比如下面的例子:
client.buy(..., order_time=datetime.datetime(2022, 3, 1, 9, 31)) client.buy(..., order_time=datetime.datetime(2022, 3, 4, 14, 31)) client.buy(..., order_time=datetime.datetime(2022, 3, 4, 14, 32)) client.sell(..., order_time=datetime.datetime(2022, 3, 7, 9, 31))
是正确的执行顺序,但下面的执行顺序必然产生错误的结果(实际上服务器也会进行检测并报错误)
client.buy(..., order_time=datetime.datetime(2022, 3, 1, 14, 31)) client.buy(..., order_time=datetime.datetime(2022, 3, 1, 9, 31)) client.sell(..., order_time=datetime.datetime(2022, 3, 7, 9, 31))
策略需要自行决定是否允许这样的情况发生,以及如果发生失,会产生什么样的后果。
Credits
This package was created with zillionare/python project wizard project template.
Metadata
Release files for zillionare-trader-client 0.4.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| zillionare_trader_client-0.4.4.tar.gz | 175.3 kB | Without provenance | Details for zillionare_trader_client-0.4.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| zillionare_trader_client-0.4.4-py3-none-any.whl | Python 3 | none | any | Details for zillionare_trader_client-0.4.4-py3-none-any.whl |
Total release size: 190.9 kB
Release files / zillionare_trader_client-0.4.4.tar.gz
| Download URL | zillionare_trader_client-0.4.4.tar.gz |
|---|---|
| Size | 175.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a6f376c479248addfb0e16324eb3ae946d7ad9198fb2dccab78902605ecf91ad
|
|
BLAKE2b-256 checksum How to use checksums |
0ff193b7925d8c5e3548b6489b727302e9f05c595ac64bd1d0f2ab49977d3027
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.8.16 Linux/5.4.0-165-generic
|
Release files / zillionare_trader_client-0.4.4-py3-none-any.whl
| Download URL | zillionare_trader_client-0.4.4-py3-none-any.whl |
|---|---|
| Size | 15.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
93212a377326fec5e6d1586adab7e31bb984740a980b74d89462dcd2855b76f9
|
|
BLAKE2b-256 checksum How to use checksums |
39ba09eda461c732472787655696f5311b8c03ef7b68187264b17534112d37ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.8.16 Linux/5.4.0-165-generic
|
Security for zillionare-trader-client 0.4.4
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.