This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

pysentosa - Python API for sentosa trading system

Project Description

pysentosa - Python API for sentosa trading system

  • pysentosa is the Python API for sentosa trading system written by Wu Fuheng

  • WebSite: http://www.quant365.com (Quant365 - Trading with Science and Technology)

  • OS: Linux Ubuntu 15.10 64bit

  • Installation:

    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
    
  • Launch your IB TWS.

  • Run your strategy to trade

    Run demo:

    from pysentosa.demo import run_demo
    run_demo()
    

    Sample code:

    from pysentosa import Merlion
    from ticktype import *
    
    m = Merlion()
    target = 'SPY'
    m.track_symbol([target, 'BITA'])
    bounds = {target: [220, 250]}
    while True:
      symbol, ticktype, value = m.get_mkdata()
      if symbol == target:
        if ticktype == ASK_PRICE and value < bounds[symbol][0]:
            oid = m.buy(symbol, 5)
            while True:
                ord_st = m.get_order_status(oid)
                print ORDSTATUS[ord_st]
                if ord_st == FILLED:
                    bounds[symbol][0] -= 20
                    break
                sleep(2)
        elif ticktype == BID_PRICE and value > bounds[symbol][1]:
            oid = m.sell(symbol, 100)
            bounds[symbol][1] += 20
    
Release History

Release History

This version
History Node

0.1.32

History Node

0.1.31

History Node

0.1.30

History Node

0.1.29

History Node

0.1.28

History Node

0.1.27

History Node

0.1.26

History Node

0.1.25

History Node

0.1.24

History Node

0.1.23

History Node

0.1.22

History Node

0.1.21

History Node

0.1.20

History Node

0.1.19

History Node

0.1.18

History Node

0.1.17

History Node

0.1.16

History Node

0.1.15

History Node

0.1.14

History Node

0.1.13

History Node

0.1.12

History Node

0.1.11

History Node

0.1.10

History Node

0.1.9

History Node

0.1.8

History Node

0.1.7

History Node

0.1.6

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.0.9

History Node

0.0.8

History Node

0.0.7

History Node

0.0.6

History Node

0.0.5

History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

History Node

0.0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pysentosa-0.1.32-py2.7.egg (5.1 MB) Copy SHA256 Checksum SHA256 2.7 Egg Mar 13, 2016
pysentosa-0.1.32.tar.gz (5.0 MB) Copy SHA256 Checksum SHA256 Source Mar 13, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting