vex1023 / vxtrader Goto Github PK
View Code? Open in Web Editor NEW**A股券商web 交易接口
License: MIT License
**A股券商web 交易接口
License: MIT License
在文档中看到下面的内容,但广发加密账号和密码的获取方法并无介绍。
from vxTrader import Trader
trader = Trader(
brokerID='gf',
account='加密后广发账号',
password='加密后的密码'
)
print(trader.portfolio)
print(trader.orderlist)
发现新的问题,自动申购报错,麻烦看下:
trader.order_auto_ipo()
2017-06-02 18:22:39.778321 INFO trader.py [line:184] === Order auto IPO
2017-06-02 18:22:40.828455 INFO gfTrader.py [line:161] === Login success: xxxxxxxxxxx
Traceback (most recent call last):
File "/root/anaconda3/lib/python3.5/site-packages/pandas/core/indexing.py", line 1434, in _has_valid_type
error()
File "/root/anaconda3/lib/python3.5/site-packages/pandas/core/indexing.py", line 1429, in error
(key, self.obj._get_axis_name(axis)))
KeyError: 'the label [1] is not in the [index]'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "/root/anaconda3/lib/python3.5/site-packages/vxTrader/trader.py", line 198, in order_auto_ipo
lmt_buy = ipo_limit.loc[ipo_list.loc[symbol, 'exchange_type'], 'amount_limits']
File "/root/anaconda3/lib/python3.5/site-packages/pandas/core/indexing.py", line 1325, in getitem
return self._getitem_tuple(key)
File "/root/anaconda3/lib/python3.5/site-packages/pandas/core/indexing.py", line 836, in _getitem_tuple
return self._getitem_lowerdim(tup)
File "/root/anaconda3/lib/python3.5/site-packages/pandas/core/indexing.py", line 967, in _getitem_lowerdim
section = self._getitem_axis(key, axis=i)
File "/root/anaconda3/lib/python3.5/site-packages/pandas/core/indexing.py", line 1551, in _getitem_axis
self._has_valid_type(key, axis)
File "/root/anaconda3/lib/python3.5/site-packages/pandas/core/indexing.py", line 1442, in _has_valid_type
error()
File "/root/anaconda3/lib/python3.5/site-packages/pandas/core/indexing.py", line 1429, in error
(key, self.obj._get_axis_name(axis)))
KeyError: 'the label [1] is not in the [index]'
trader.order_target('sh600497', target_weight=0.001)
2017-05-24 09:06:51.890253 INFO trader.py [line:152] === Order target: symbol(sh600497), target_amount(None), target_volume(None), target_weight(0.001)
2017-05-24 09:06:55.046009 INFO trader.py [line:90] === order: symbol(sh600497), amount(0.00), volume(0.00), weight(0.0010)
2017-05-24 09:06:55.087457 INFO trader.py [line:65] === buy: symbol(sh600497), price(0.0), amount(10300.0)
当时我全仓只能买10300.0,虽然设置target_weight=0.001,但是还是全仓购买。我改成其他的比例也一样有问题。应该是个bug
部分终端出现字符问题。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.