Quantaxis

Latest version: v1.10.19

Safety actively analyzes 630169 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 6 of 6

1.2.5

1. 对于QA.QA_util_code_tostr 增加 原先为list类型的支持 现在支持自动补全的 int/list/str 类型转 str
2. QA_DataStruct增加bar_gen 返回迭代的dataframe
3. 增加对于期货的日结算支持:

在期货的保证金模型中:

开仓会冻结保证金到frozen里面, 这时钱并未参与结算/ 需要先在每日结算时结转冻结的保证金
4. 增加了QA_Account的 history_table字段,增加了一个 frozen字段, 用于记录历史的保证金增加
5. 大幅删减QA_Account的 receive_deal 精简代码 直接调用receive_simpledeal方法
6. QADATASTRUCT 增加一个 kline_echarts 方法 直接返回 echarts.kline类 可以在jupyter notebook中直接显示
7. QALog模块的默认输出为warning级别, 减少别的模块的无聊输出(点名: 尤其是macropy 疯狂输出)

plot的图示例:

- 可能需要先升级pyecharts 到最新版本 (pip install pyecharts -U -i https://pypi.doubanio.com/simple)

![](http://pic.yutiansut.com/QQ%E5%9B%BE%E7%89%8720190103220819.png)

1.2.3

1. 感谢追梦, QA_Account的receive_simpledeal的成交方式中的 股票市场的印花税计算修正
2. 改写地下的地下铁, 修正QA_Risk中计算assets的一个停牌无数据的bug
3. 感谢风筝 修复了单标的多市场的获取bug
4. 重大修改: 增加保证金账户的支持(期货)


具体示例 参见: https://github.com/QUANTAXIS/QUANTAXIS/blob/master/EXAMPLE/test_backtest/FUTURE/TEST_%E4%BF%9D%E8%AF%81%E9%87%91%E8%B4%A6%E6%88%B7.ipynb

python
在QA_Account的初始化的时候带上 allow_margin=True

acc=QA.QA_Account(allow_sellopen=True,init_cash=10000,allow_t0=True,allow_margin=True,account_cookie='future_test',market_type=QA.MARKET_TYPE.FUTURE_CN,frequence=QA.FREQUENCE.FIFTEEN_MIN)



快速撮合接口的测试

acc.reset_assets(init_cash=10000)

acc.receive_simpledeal(code='RB1901', trade_price=3420, trade_amount=1, trade_towards=QA.ORDER_DIRECTION.BUY_OPEN, trade_time='2018-12-28 09:30:00')

acc.receive_simpledeal(code='RB1901', trade_price=3425, trade_amount=1, trade_towards=QA.ORDER_DIRECTION.SELL_CLOSE, trade_time='2018-12-28 09:45:00')

acc.receive_simpledeal(code='RB1901', trade_price=3435, trade_amount=1, trade_towards=QA.ORDER_DIRECTION.SELL_OPEN, trade_time='2018-12-28 09:55:00')

acc.receive_simpledeal(code='RB1901', trade_price=3420, trade_amount=1, trade_towards=QA.ORDER_DIRECTION.BUY_CLOSE, trade_time='2018-12-28 10:45:00')

acc.history_table
"""
datetime code price amount cash order_id realorder_id trade_id account_cookie commission tax message
0 2018-12-28 09:30:00 RB1901 3420 1 6918.580 None None None future_test 3.420 0 None
1 2018-12-28 09:45:00 RB1901 3425 -1 10038.155 None None None future_test 3.425 0 None
2 2018-12-28 09:55:00 RB1901 3435 -1 6943.220 None None None future_test 3.435 0 None
3 2018-12-28 10:45:00 RB1901 3420 1 10166.300 None None None future_test 3.420 0 None
"""
acc.frozen
"""
{'RB1901': {2: {'money': 0, 'amount': 0}, -2: {'money': 0, 'amount': 0}}}
"""

0.12

2. 支持python3.8的docker
3. 支持TensorFlow2.2+
4. 新版本的QAFactor
5. 移除jqdatasdk
6. 新版的docker build // 新镜像 daocloud.io/quantaxis/qacommunity-rust-1-10-2:latest

Page 6 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.