Zillionare Trader Client
Project description
大富翁交易客户端
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file zillionare-trader-client-0.3.9.tar.gz
.
File metadata
- Download URL: zillionare-trader-client-0.3.9.tar.gz
- Upload date:
- Size: 160.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.13 Linux/5.4.0-113-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2683c624d578f91bd77323c9d1127f7e539dd7662e0de2f96d13aca0562b6c1 |
|
MD5 | 579b2213bc857b49d3e64b43a664105a |
|
BLAKE2b-256 | 003ad25af2bb0ad345ddfdfee34b0afeefe315bdba86ce092fd982aaee777b27 |
File details
Details for the file zillionare_trader_client-0.3.9-py3-none-any.whl
.
File metadata
- Download URL: zillionare_trader_client-0.3.9-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.13 Linux/5.4.0-113-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 743a2293b050273b1eea486e002ab9ba2e31f791cef36a096b77df0bc1505831 |
|
MD5 | 6bc42d0679f6adf26e7964aab99bbc86 |
|
BLAKE2b-256 | 5a8e6acf8738d326460745283afaca3ba6bc6fe2a409a8d730be497749c7d034 |