IB-Ruby aims to provide a ready-to-go solution for everyday aspects of serious trading of stocks and derivates through Interactive Brokers. Additional tools are covered in this documentation as well as best practice examples.

Setup describes how to setup the environment, to install IB-Ruby locally and start a project that has access to the TWS.

Console assists through first experiments with the software.

Modular Approach using Plugins

The TWS-API supports a variety of applications. It can be used to aggregate news, fetch quotes, download historical data, load option-chains and last not least to place orders.

Centerpiece of IB-Ruby is ib-api, which provides a low-level interface to the Interactive Brokers TWS- or Gateway-api. Basically the user sends messages to the tws and subscribes to expected responses. Plugins extent its functionality and provide useful automations.

Extensions

  • connection-tools provides a robust connection approach and offers check_connection to ensure liable order executions
  • managed-accounts introduces clients and keeps account- and portfolio-values as well as current contracts for every account detected
  • advanced-account enables account-based trading; provides client.preview, -place, -modify, -close and -cancel
  • process-orders
  • symbols offers shortcuts to most used contracts and provides a file based management of watchlists.

Automations

  • verify queries the TWS and validates the input for contracts
  • market-price manages the query for most recent market-data
    • eod fetches historical (end of day) data
  • order-prototypes ease the usage of advanced ordertypes
  • spread-prototypes offers a user friendly way to define most common spreads
  • roll offers the ability to roll options and futures to other strikes and expiries
  • option-chains fetch at- in- and out-of-the-money options with just one command
  • greeks fetch option-greeks and store in the OptionGreeks-Object

Status

The components are ready to be used in production.

(Last update: Jul 9, 2024)