forked from ib-ruby/ib-ruby
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,866 additions
and
827 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Settings><!--This file was automatically generated by Ruby plugin. | ||
You are allowed to: | ||
1. Remove rake task | ||
2. Add existing rake tasks | ||
To add existing rake tasks automatically delete this file and reload the project. | ||
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Alias to doc:rdoc" fullCmd="doc" taksId="doc" /><RakeGroup description="" fullCmd="" taksId="doc"><RakeTask description="Remove rdoc products" fullCmd="doc:clobber_rdoc" taksId="clobber_rdoc" /><RakeTask description="Build the rdoc HTML Files" fullCmd="doc:rdoc" taksId="rdoc" /><RakeTask description="Force a rebuild of the RDOC files" fullCmd="doc:rerdoc" taksId="rerdoc" /><RakeTask description="" fullCmd="doc:clobber" taksId="clobber" /></RakeGroup><RakeTask description="Alias to gem:build" fullCmd="gem" taksId="gem" /><RakeGroup description="" fullCmd="" taksId="gem"><RakeTask description="(Re-)Build gem" fullCmd="gem:build" taksId="build" /><RakeTask description="Cleanup already installed gem(s)" fullCmd="gem:cleanup" taksId="cleanup" /><RakeTask description="Build and install gem" fullCmd="gem:install" taksId="install" /><RakeTask description="Build and push gem to Gemcutter" fullCmd="gem:release" taksId="release" /></RakeGroup><RakeTask description="Alias to git:commit" fullCmd="git" taksId="git" /><RakeGroup description="" fullCmd="" taksId="git"><RakeTask description="Stage and commit your work [with message]" fullCmd="git:commit[message]" taksId="commit[message]" /><RakeTask description="Push local changes to Github" fullCmd="git:push" taksId="push" /><RakeTask description="Create (release) tag on Github" fullCmd="git:tag" taksId="tag" /><RakeTask description="" fullCmd="git:commit" taksId="commit" /></RakeGroup><RakeTask description="Alias to gem:install" fullCmd="install" taksId="install" /><RakeTask description="Alias to gem:release" fullCmd="release" taksId="release" /><RakeTask description="Alias to spec:spec" fullCmd="spec" taksId="spec" /><RakeGroup description="" fullCmd="" taksId="spec"><RakeTask description="Run specs with RCov" fullCmd="spec:rcov" taksId="rcov" /><RakeTask description="Run all specs" fullCmd="spec:spec" taksId="spec" /></RakeGroup><RakeTask description="Set version: [x.y.z] - explicitly, [1/10/100] - bump major/minor/patch, [.build] - build" fullCmd="version[command,desc]" taksId="version[command,desc]" /><RakeTask description="" fullCmd="notes" taksId="notes" /><RakeTask description="" fullCmd="rdoc" taksId="rdoc" /><RakeTask description="" fullCmd="rdoc/index.html" taksId="rdoc/index.html" /><RakeTask description="" fullCmd="version" taksId="version" /></RakeGroup></Settings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,7 @@ | |
== 0.4.4 / 2011-09-05 | ||
|
||
* IB references and Java examples added | ||
|
||
== 0.4.5 / 2011-09-06 | ||
|
||
* Sample scripts updated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.4.4 | ||
0.4.5 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env ruby | ||
# | ||
# This script connects to IB API, subscribes to account info and prints out | ||
# messages received from IB (update every 3 minute or so) | ||
|
||
require 'pathname' | ||
require 'rubygems' | ||
require 'bundler/setup' | ||
|
||
LIB_DIR = (Pathname.new(__FILE__).dirname + '../lib/').realpath.to_s | ||
$LOAD_PATH.unshift LIB_DIR unless $LOAD_PATH.include?(LIB_DIR) | ||
|
||
require 'ib-ruby' | ||
|
||
# First, connect to IB TWS. | ||
ib = IB::IB.new | ||
|
||
# Uncomment this for verbose debug messages: | ||
# IB::IBLogger.level = Logger::Severity::DEBUG | ||
|
||
## Subscribe to the messages that TWS sends in response to a request | ||
## for account data. | ||
|
||
ib.subscribe(IB::IncomingMessages::AccountValue, lambda { |msg| | ||
puts msg.to_human | ||
}) | ||
|
||
ib.subscribe(IB::IncomingMessages::PortfolioValue, lambda { |msg| | ||
puts msg.to_human | ||
}) | ||
|
||
ib.subscribe(IB::IncomingMessages::AccountUpdateTime, lambda { |msg| | ||
puts msg.to_human | ||
}) | ||
|
||
ib.dispatch(IB::OutgoingMessages::RequestAccountData.new(:subscribe => true, | ||
:account_code => '')) | ||
|
||
|
||
puts "\nSubscribing to IB account data" | ||
puts "\n******** Press <Enter> to cancel... *********\n\n" | ||
gets | ||
puts "Cancelling account data subscription.." | ||
|
||
ib.dispatch(IB::OutgoingMessages::RequestAccountData.new(:subscribe => false, | ||
:account_code => '')) | ||
puts "Done." | ||
|
Oops, something went wrong.