Documentation: https://ib-ruby.github.io/ib-doc/
Questions, Contributions, Remarks: Discussions are opened in ib-api
Helpers and Macros that ease the usage of the TWS-API of Interactive Brokers
To activate use
gem 'ib-extensions'
in the Gemfile and require the extensions as needed
(except gateway)
require 'ib-api'
require 'ib/extensions'
require 'ib-api'
require 'ib/verify'
Verifies a given contract, for details refer to the documentation
require 'ib-api'
require 'ib/market-price'
Returns the most recent market-price of a given contract ( documentation )
require 'ib-api'
require 'ib/eod'
puts IB::Symbols.Index.estx.eod( duration: '10 d' )
Fetch historical data with just one line of code (documentation )
require 'ib-api'
require 'ib/order-prototypes'
order = IB::Limit.order size: 100, price: 10, action: :buy
order = IB::StopLimit.order size: 100, price: 10, stop_price: 9.5
then transmit the order through the place_order method of IB::Connection or Account-based preview, place, modify and cancel methods of IB::Gateway.
More details in the documentation
require 'ib-api'
require 'ib/spread-prototypes'
Compose most common spreads through
s = IB::Straddle.build from: IB::Symbols::Index.stoxx,
strike: 2400,
expiry: 202103
s = IB::Strangle.build from: IB::Symbols::Index.stoxx,
c: 2400, p: 2200,
expiry: 202103
and use the speads like any other contract. (documentation
require 'ib-gateway'
IB::Gateway is an alternative to IB::Connection. Upon initialization, it detects active accounts and stores them in a thread safe array. Details in the documentation
Its used in Simple Monitor
Bug reports and pull requests are welcome on GitHub at https://github.com/ib-ruby/ib-extensions. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
Everyone interacting in the Ib::Extensions project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.