Giter Site home page Giter Site logo

vxtrader's People

Contributors

vex1023 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vxtrader's Issues

如何获取广发加密后的用户名和密码?

在文档中看到下面的内容,但广发加密账号和密码的获取方法并无介绍。

使用方法

from vxTrader import Trader
trader = Trader(
brokerID='gf',
account='加密后广发账号',
password='加密后的密码'
)

print(trader.portfolio)

print(trader.orderlist)

支持券商

  • 广发证券————('gf')

自动IPO申购接口

  1. 查询可申购份数;
  2. 进行下单,如果申购份数不足时,随机分配多只新股申购

自动申购报错

发现新的问题,自动申购报错,麻烦看下:

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]'

order_target 或者 order 在设置weight的时候无效。好像都是全仓购买

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.