Metadata-Version: 1.0
Name: pysentosa
Version: 0.1.10
Summary: Sentosa - An automatic algorithmic trading system
Home-page: http://www.quant365.com
Author: Wu Fuheng
Author-email: henry.woo@outlook.com
License: GPL
Description: pysentosa - Python API for sentosa trading system
        ============================================================================================
        
        - OS: Linux Ubuntu 15.04 64bit
        
        - Installation: 
        
          ::
        
            sudo apt-get install -y python-pip libboost-all-dev libmysqlclient18 libyaml-cpp0.5
            sudo easy_install http://pypi.python.org/packages/2.7/p/pysentosa/pysentosa-0.1.10-py2.7.egg
            pip install pyyaml pymysql netifaces websocket-client nanomsg
            mkdir /singapore/config -p
            cd /singapore/config
            wget https://raw.githubusercontent.com/henrywoo/qblog/master/sentosa.yml
            wget https://raw.githubusercontent.com/henrywoo/qblog/master/holiday.yml
        
        - Launch your IB TWS.
        
        - Run your strategy to trade
          
          Sample code:
        
            ::
        
              from pysentosa.merlion import *
        
              m = Merlion().run() # start trading engine
              target = 'SPY'      # set trading symbol as SP 500 ETF
              m.track_msg(target) # (optional) print tick data to stdout
              bounds = {target: [200, 250]} # set lower and upper bounds of triggering trade signal
              ''' the followings are your trading strategy'''
              while True:
                symbol, ticktype, value = m.get_mkdata() #listen on tick data
                if symbol == target:
                  if ticktype == ASK_PRICE and value < bounds[symbol][0]:
                    m.buy(symbol, 100)
                    bounds[symbol][0] -= 10
                  elif ticktype == BID_PRICE and value > bounds[symbol][1]:
                    m.sell(symbol, 100)
                    bounds[symbol][1] += 10
        
        
Keywords: sentosa,python
Platform: Independant
