<commit_before># ib-ruby

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

Copyright (C) 2006-2011 <NAME>, <NAME>, and <NAME>.

https://github.com/ib-ruby/ib-ruby

__WARNING:__ This software is provided __AS-IS__ with __NO WARRANTY__, express or
implied. Your use of this software is at your own risk. It may contain
any number of bugs, known or unknown, which might cause you to lose
money if you use it. You've been warned.

__It is specifically NOT RECOMMENDED that this code be used for live trading.__

This code is not sanctioned or supported by Interactive Brokers
This software is available under the LGPL. See the file LICENSE for full licensing details.


## REQUIREMENTS:

Either the Interactive Brokers
[TWS](http://www.interactivebrokers.com/en/p.php?f=tws) or
[IB Gateway](http://www.interactivebrokers.com/en/control/systemstandalone-ibGateway.php?os=unix&ib_entity=llc)
software must be installed and configured to allow API connections
from the computer you plan to run ib-ruby on, which is typically
localhost if you're running ib-ruby on the same machine as TWS.

## INSTALLATION:

### From RubyGems

    $ sudo gem install ib-ruby

### From Source

    $ git clone https://github.com/ib-ruby/ib-ruby
    $ cd ib-ruby; rake gem:install

## SYNOPSIS:

First, start up Interactive Broker's Trader Work Station or Gateway.
Make sure it is configured to allow API connections on localhost, and note
the port for some strange reason IB gave TWS and the Gateway different ports,
this library assumes the gateway one of 4001, this can also be set on the
API - Setting page of TWS.

    >> require 'ib-ruby'
    >> ib = IB::Connection.new
    >> ib.subscribe(:Alert, :AccountValue) { |msg| puts msg.to_human }
    >> ib.send_message :RequestAccountData, :subscribe => true

Your code and TWS interact via an exchange of messages. You
subscribe to message types you're interested in using
`IB::Connection#subscribe` and request data from TWS using
`IB::Connection#send_message`.

The code blocks (or procs) given to `#subscribe` will be executed when
a message of the requested type is received, with the received message as
its argument.

See `lib/ib-ruby/messages` for a full list of supported incoming/outgoing messages and
their attributes. The original TWS docs and code samples can be found
in the `misc/` folder.

The sample scripts in the `bin/` directory provide examples of how
common tasks can be achieved using ib-ruby.


## LICENSE:<commit_msg>Typo in README change.<commit_after># ib-ruby

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

Copyright (C) 2006-2011 <NAME>, <NAME>, and <NAME>.

https://github.com/ib-ruby/ib-ruby

__WARNING:__ This software is provided __AS-IS__ with __NO WARRANTY__, express or
implied. Your use of this software is at your own risk. It may contain
any number of bugs, known or unknown, which might cause you to lose
money if you use it. You've been warned.

__It is specifically NOT RECOMMENDED that this code be used for live trading.__

This code is not sanctioned or supported by Interactive Brokers
This software is available under the LGPL. See the file LICENSE for full licensing details.


## REQUIREMENTS:

Either the Interactive Brokers
[TWS](http://www.interactivebrokers.com/en/p.php?f=tws) or
[IB Gateway](http://www.interactivebrokers.com/en/control/systemstandalone-ibGateway.php?os=unix&ib_entity=llc)
software must be installed and configured to allow API connections
from the computer you plan to run ib-ruby on, which is typically
localhost if you're running ib-ruby on the same machine as TWS.

## INSTALLATION:

### From RubyGems

    $ sudo gem install ib-ruby

### From Source

    $ git clone https://github.com/ib-ruby/ib-ruby
    $ cd ib-ruby; rake gem:install

## SYNOPSIS:

First, start up Interactive Broker's Trader Work Station or Gateway.
Make sure it is configured to allow API connections on localhost, and note
the port. For some strange reason IB gave TWS and the Gateway different ports,
this library assumes the gateway one of 4001, this can also be set on the
API - Setting page of TWS.

    >> require 'ib-ruby'
    >> ib = IB::Connection.new
    >> ib.subscribe(:Alert, :AccountValue) { |msg| puts msg.to_human }
    >> ib.send_message :RequestAccountData, :subscribe => true

Your code and TWS interact via an exchange of messages. You
subscribe to message types you're interested in using
`IB::Connection#subscribe` and request data from TWS using
`IB::Connection#send_message`.

The code blocks (or procs) given to `#subscribe` will be executed when
a message of the requested type is received, with the received message as
its argument.

See `lib/ib-ruby/messages` for a full list of supported incoming/outgoing messages and
their attributes. The original TWS docs and code samples can be found
in the `misc/` folder.

The sample scripts in the `bin/` directory provide examples of how
common tasks can be achieved using ib-ruby.


## LICENSE:
{'fraction_non_alphanumeric': 0.07538891104906262, 'fraction_numerical': 0.005983246908655764, 'mean_word_length': 4.290084388185654, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 27, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4343650', 'n_tokens_mistral': 1503, 'n_tokens_neox': 1390, 'n_words': 670}