GithubHelp home page GithubHelp logo

tradeapi's Introduction

TradeApi

标准交易API定义

安装步骤

1、安装Python环境

如果本地还没有安装Python环境,强烈建议安装Anaconda(Python的集成开发环境,包含众多常用包,且易于安装,避免不必要的麻烦)。打开Anaconda官网,选择相应的操作系统,确定要安装的Python版本,进行下载。

下载完成以后,按照图形界面步骤完成安装。在默认情况下,Anaconda会自动设置PATH环境。

:如果安装过程遇到问题,或需要更详细的步骤,请参见安装Anaconda Python环境教程

2、安装依赖包

如果Python环境不是类似Anaconda的集成开发环境,我们需要单独安装依赖包,在已经有pandas/numpy包前提下,还需要有以下几个包:

  • pyzmq
  • msgpack_python
  • python-snappy

可以通过单个安装完成,例如: pip install pyzmq

需要注意的是,python-snappy的安装需要比较多的编译依赖,请按照如何安装python-snappy包所述安装。

3、使用TradeApi

在项目目录,验证TradeApi是否能够正常使用。

from TradeApi import TradeApi  # 这里假设项目目录名为TradeApi, 且存放在工作目录下

api = TradeApi(addr="tcp://gw.quantos.org:8901")
result, msg = api.login("username", "token") # 示例账户,用户需要改为自己在www.quantos.org上注册的账户
print result
print msg

tradeapi's People

Contributors

quantosorg avatar pkujohnson avatar

Watchers

James Cloos avatar  avatar

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.