Giter Site home page Giter Site logo

untws's Introduction

untws

"Pythonic" access to Interactive Brokers TWS (uses IbPy)

Introduction

The goal of this Python library is to provide a well-documented, more Pythonic way to access Interactive Brokers TWS. The excellent IbPy library already provides access to TWS, and it mimics the Java API, which is event-driven and asynchronous. untws uses IbPy behind the scenes to provide a more direct (i.e. synchronous) access, which is more suitable for scripts and other non-GUI tools.

Requirements

untws requires IbPy. Install it with:

$ wget https://github.com/blampe/IbPy/archive/master.zip
$ unzip master.zip
$ cd IbPy-master/

# to install it in the system libraries
$ python setup.py.in install

# to install it for the current user only:
$ python setup.py.in install --user

Sadly, IbPy cannot be used with pip in its current state.

Installation

Install the latest untws directly with pip:

$ pip install https://github.com/maanbsat/untws/archive/master.zip

Quick Howto

from untws import ib_connect

# ib_connect will connect to localhost and port 7496
# Alternatively, pass in the hostname and/or port parameters,
# or set the IB_HOSTNAME and/or IB_PORT environment variables
con = ib_connect()

con.get_current_time()
con.get_positions()

# get market data
stk = con.create_stock('IBM')
mkt_data = con.get_market_data(stk)

# access fields directly
mkt_data.last
mkt_data.bid
mkt_data.ask

# same for options
opt = con.create_option_ticker('IBM   130921P00180000')
mkt_data = con.get_market_data(opt)

Todo

  • Functionality
    • Retrieve hitorical data
    • Create orders
  • Add documentation
  • Expand the Todo list

untws's People

Contributors

maanbsat avatar

Watchers

 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.