Pysentosa-用于Sentosa交易系统的PythonAPI

pysentosa的Python项目详细描述


Pysentosa-用于Sentosa交易系统的Python API

http://www.quant365.com/static/merlion.png
  • Pysentosa是吴福恒为圣淘沙交易系统编写的PythonAPI

  • 网址:http://www.quant365.com(quant365-科技贸易)

  • 操作系统:Linux Ubuntu15.10 64位

  • 安装:

    GITURL=https://raw.githubusercontent.com/henrywoo/pysentosa/master
    wget $GITURL/install_nanomsg.sh -O install_nanomsg.sh
    chmod u+x install_nanomsg.sh
    ./install_nanomsg.sh
    
    wget $GITURL/install_yaml_cpp.sh -O install_yaml_cpp.sh
    chmod u+x install_yaml_cpp.sh
    ./install_yaml_cpp.sh
    
    sudo apt-get install -y python-pip libboost-all-dev
    sudo pip install -U pysentosa pyyaml netifaces websocket-client nanomsg \
      setproctitle psutil
    
  • 启动IB TWS。

  • 执行交易策略

    运行演示:

    frompysentosa.demoimportrun_demorun_demo()

    示例代码:

    frompysentosaimportMerlionfromticktypeimport*m=Merlion()target='SPY'm.track_symbol([target,'BITA'])bounds={target:[220,250]}whileTrue:symbol,ticktype,value=m.get_mkdata()ifsymbol==target:ifticktype==ASK_PRICEandvalue<bounds[symbol][0]:oid=m.buy(symbol,5)whileTrue:ord_st=m.get_order_status(oid)printORDSTATUS[ord_st]iford_st==FILLED:bounds[symbol][0]-=20breaksleep(2)elifticktype==BID_PRICEandvalue>bounds[symbol][1]:oid=m.sell(symbol,100)bounds[symbol][1]+=20
Bitdeli badge

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Android Action_Edit Intent无法像以前一样调用App Gallery来编辑图片   确保JRE兼容性的java适当程序(32或64位)   java JSONArray。for循环中的add(JSONObject)正在替换for循环中的旧值,数组由循环中的最后一个值组成   java需要帮助创建一个返回数组的方法,该数组的元素是另一个数组的平方   使用SmbFile w/groovy XmlSluper()创建xml。解析()Java   检查大小后的java ArrayIndexOutOfBoundsException   乘法表中的第k个最小元素   java 401 on请求,其中指定了'permitAll()'   java如何附加ORC文件   java hibernate类模型   java IDEA没有看到由自定义注释处理器生成的方法   Servlet中未声明java SerialVersionId   java linkedlist到达列表末尾时   java如何正确对齐EditText光标?   java 6编译器1.6上的eclipse重写方法错误   java如何在基于Jersey的RESTful Web服务中读取post数据   java如何在活动中正确使用接口?   Java的JIT编译器的工作速度有多快?