Skip to content
@ib-ruby

ib-ruby

IB-Ruby

Ruby Implementation of the Interactive Brokers Trader Workstation (TWS) API.

Documentation: https://ib-ruby.github.io/ib-api/

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.

ib-api 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.

To experiment with the program, an interactive console is included

work:~/labor/ib-api/bin$ ./console 

>> IB-API Interactive Console <<
---------------------------------------------
Namespace is IB ! 
---------------------------------------------
W: Workflow::  -> gateway_mode
F: Connected to server, version: 165, using client-id: 2000,
   connection time: 2024-11-23 19:38:01 +0100 local, 2024-11-23T18:38:01+00:00 remote.
W: Workflow:: gateway_mode -> ready
A: Market data farm connection is OK:eufarm
A: HMDS data farm connection is inactive but should be available upon demand.euhmds
A: Sec-def data farm connection is OK:secdefeu
W: Workflow:: ready -> account_based_operations
W: Workflow:: account_based_operations -> account_based_orderflow
account_based_orderflow
I: DUXXXXXXX => Count of AccountValues: 134
I: DUYYYYYYY => Count of AccountValues: 135
A: API client has been unsubscribed from account data.
Connection established on  localhost:4002

┌────────────────────────────────────────────────────────────────────────┐
│                             Active Plugins                             │
├───────────────────┬──────────────────┬──────────────────┬──────────────┤
│ advanced-account  │ connection-tools │ managed-accounts │ market-price │
│ order-flow        │ order-prototypes │ process-orders   │ roll         │
│ spread-prototypes │ symbols          │ verify           │              |
└───────────────────┴──────────────────┴─────────────────────────────────┘

----> C    points to the connection-instance
---------------------------------------------
3.2.0 :001 > client =  C.clients.last
 => <demo_user DU4035279> 
3.2.0 :002 > puts client.portfolio_values.as_table
┌────────────┬───────────────────────┬───────┬────────┬────────┬──────────┬────────────┬──────────┐
│            │                       │ pos   │ entry  │ market │ value    │ unrealized │ realized │
╞════════════╪═══════════════════════╪═══════╪════════╪════════╪══════════╪════════════╪══════════╡
│ DU4035279  │ Stock: DBK EUR IBIS   │  1400 │ 10.511 │ 15.574 │  21803.6 │     7088.2 │          │
│ DU4035279  │ Stock: F USD NYSE     │  1300 │ 14.212 │  11.18 │  14534.0 │   -3941.47 │          │
│ DU4035279  │ Stock: LNZ EUR VSE    │   114 │ 45.949 │  29.55 │   3368.7 │   -1869.47 │          │
│ DU4035279  │ Stock: SIE EUR IBIS   │  -100 │ 179.91 │ 177.62 │ -17762.0 │      229.0 │          │
│ DU4035279  │ Stock: TKA EUR IBIS   │  1300 │  8.871 │  3.803 │   4943.9 │    -6588.4 │          │
│ DU4035279  │ Stock: TLT USD NASDAQ │ -1000 │ 90.772 │  90.45 │ -90450.0 │     322.23 │          │
│ DU4035279  │ Stock: TUI1 EUR IBIS  │   180 │  43.21 │  7.434 │  1338.12 │   -6439.68 │          │
└────────────┴───────────────────────┴───────┴────────┴────────┴──────────┴────────────┴──────────┘

Popular repositories Loading

  1. ib-ruby ib-ruby Public archive

    Historic Ruby interface to Interactive Brokers' TWS API

    Ruby 124 59

  2. ib-api ib-api Public

    Lightweight Ruby interface to Interactive Brokers' TWS API

    Ruby 18 9

  3. ib-container ib-container Public

    Provides a Container executing TWS/Gateway in an isolated environment.

    Shell 10 1

  4. simple-monitor simple-monitor Public

    Web Interface to a IB-Account(s). Can be accessed with a terminal.

    Ruby 7 2

  5. ib-trading-system ib-trading-system Public

    Automatic trading on interactive brokers tws

    Ruby 4

  6. ib-technical-analysis ib-technical-analysis Public

    A library for performing technical analysis

    Ruby 2 1

Repositories

Showing 10 of 14 repositories
  • ib-api Public

    Lightweight Ruby interface to Interactive Brokers' TWS API

    ib-ruby/ib-api’s past year of commit activity
    Ruby 18 GPL-3.0 9 2 3 Updated Nov 27, 2024
  • .github Public
    ib-ruby/.github’s past year of commit activity
    0 0 0 0 Updated Nov 23, 2024
  • ib-extensions Public

    Helpers and Macros that ease the usage of the TWS-API of Interactive Brokers through IB-Ruby

    ib-ruby/ib-extensions’s past year of commit activity
    Ruby 0 1 1 0 Updated Sep 19, 2024
  • ib-symbols Public

    Predefined symbols and watchlists for contracts, formally part of ib-ruby

    ib-ruby/ib-symbols’s past year of commit activity
    Ruby 1 0 0 0 Updated Sep 3, 2024
  • ruby-technical-analysis Public Forked from johnnypaper/ruby-technical-analysis

    Ruby technical analysis toolkit for stocks, commodities, and other time series.

    ib-ruby/ruby-technical-analysis’s past year of commit activity
    Ruby 0 MIT 2 0 0 Updated Feb 10, 2024
  • ib-examples Public

    Collection of working skripts

    ib-ruby/ib-examples’s past year of commit activity
    Jupyter Notebook 0 MIT 0 0 0 Updated Apr 11, 2023
  • bridgetown-ib-ruby Public Forked from topofocus/bridgetown-ib-ruby

    Plugin to access the Interactive Brokers TWS-API from Bridgetown

    ib-ruby/bridgetown-ib-ruby’s past year of commit activity
    Ruby 0 MIT 1 0 0 Updated Mar 6, 2023
  • ib-container Public

    Provides a Container executing TWS/Gateway in an isolated environment.

    ib-ruby/ib-container’s past year of commit activity
    Shell 10 MIT 1 0 0 Updated Feb 13, 2023
  • ib-orientdb Public

    Part of IB-Ruby. Provides access to an OrientDB-Database

    ib-ruby/ib-orientdb’s past year of commit activity
    Ruby 0 MIT 0 0 0 Updated Jan 30, 2023
  • simple-monitor Public

    Web Interface to a IB-Account(s). Can be accessed with a terminal.

    ib-ruby/simple-monitor’s past year of commit activity
    Ruby 7 MIT 2 0 0 Updated Aug 21, 2021

Top languages

Loading…

Most used topics

Loading…