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-doc/

A plain vanilla access is provided through ib-api.
ib-api sends Messages to the TWS-API and stores the response in a received-array. The program just waits for the correct response

the_stock =  IB::Stock.new symbol: 'GE'
limit_order = IB::Order.new  limit_price: 35, order_type: 'LMT',  total_quantity: 100, action: :buy
ib.send_message :PlaceOrder,
        :order => limit_order,
        :contract => the_stock,
        :local_id => ib.next_local_id

# wait until the orderstate message returned
ib.wait_for :OrderStatus

Alternatively, its possible to subscribe to certain messages

ib.subscribe(:Alert, :ContractData, :ContractDataEnd ) do |msg| 
	case msg
	when Messages::Incoming::Alert
		  # do something asynchronous
	when Messages::Incoming::ContractDataEnd 
       # do something asyncronous
  else
      # asynchronous response to ContractData
  end  
 end
 # perform request
 request_id = ib.send_message :RequestContractData, :contract => Stock.new(symbol: 'T')

IB-Gateway

To ease the access of the data on the tws-servers, ib-extensions provides helpers and macros

  • Verifiyng of contracts
  • get Market-Price, Option-Greeks from a single contract
  • load EOD-Data
  • define Ordertypes, ie. Limit.order, Stop.order ...
  • easily define Straddles, Strangles, Calendars, Butterflies and other option-spreads

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 Jul 16, 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 Apr 23, 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-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 Apr 24, 2023
  • 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
  • .github Public
    ib-ruby/.github’s past year of commit activity
    0 0 0 0 Updated Jan 10, 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…