IB-Ruby provides Ruby-Gems ready for use in ruby projects.
Setup a new project
$ mkdir ~/workspace/trading_project && cd ~/workspace/trading_project
$ git init # Version Control
$ cp ../ib-api/.gitignore . # use the same directives than ib-api
$ bundle init # create Gemfile
Edit the Gemfile
and add the following
$ vi Gemfile
gem "ib-api"
gem "ib-extensions"
and finally
$ bundle install
Now, every script using
require 'bundler/setup'
require 'ib-api'
## or
require 'ib-gateway'
can access the services of IB-Ruby.
IB-Examples
The IB-Examples repository contains a variety of sample scripts.
A local Console
Copy the /bin
-directory of ib-api
or ib-extensions
to your project-directory and modify the console
-script to your needs. Details: Interactive Console