ib-api 972.0 → 972.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +36 -37
- data/README.md +48 -3
- data/VERSION +1 -1
- data/api.gemspec +1 -1
- data/bin/console +4 -8
- data/changelog.md +12 -0
- data/lib/ib/base_properties.rb +3 -4
- data/lib/ib/connection.rb +18 -16
- data/lib/ib/logger.rb +1 -1
- data/lib/ib/messages/incoming.rb +1 -1
- data/lib/ib/messages/incoming/abstract_message.rb +7 -7
- data/lib/ib/messages/incoming/account_value.rb +5 -1
- data/lib/ib/messages/incoming/contract_data.rb +0 -2
- data/lib/ib/messages/incoming/historical_data.rb +25 -5
- data/lib/ib/messages/incoming/ticks.rb +21 -60
- data/lib/ib/messages/outgoing.rb +4 -2
- data/lib/ib/messages/outgoing/abstract_message.rb +3 -3
- data/lib/ib/messages/outgoing/bar_requests.rb +4 -5
- data/lib/ib/messages/outgoing/request_marketdata.rb +10 -7
- data/lib/ib/models.rb +1 -1
- data/lib/ib/support.rb +32 -15
- data/lib/logging.rb +45 -0
- data/lib/models/ib/account.rb +0 -13
- data/lib/models/ib/bag.rb +7 -1
- data/lib/models/ib/bar.rb +1 -1
- data/lib/models/ib/combo_leg.rb +22 -0
- data/lib/models/ib/contract.rb +44 -32
- data/lib/models/ib/contract_detail.rb +13 -7
- data/lib/models/ib/index.rb +1 -1
- data/lib/models/ib/option.rb +8 -2
- data/lib/models/ib/option_detail.rb +19 -3
- data/lib/models/ib/order.rb +5 -0
- data/lib/models/ib/spread.rb +168 -0
- data/lib/models/ib/stock.rb +9 -3
- data/lib/models/ib/underlying.rb +4 -1
- data/lib/requires.rb +10 -3
- metadata +9 -20
- data/example/README.md +0 -76
- data/example/account_info +0 -54
- data/example/account_positions +0 -30
- data/example/account_summary +0 -88
- data/example/cancel_orders +0 -74
- data/example/fa_accounts +0 -25
- data/example/fundamental_data +0 -40
- data/example/historic_data_cli +0 -186
- data/example/list_orders +0 -45
- data/example/portfolio_csv +0 -81
- data/example/scanner_data +0 -62
- data/example/template +0 -19
- data/example/tick_data +0 -28
data/example/tick_data
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# This script reproduces https://github.com/ib-ruby/ib-ruby/issues/12
|
4
|
-
|
5
|
-
require 'bundler/setup'
|
6
|
-
require 'ib-api'
|
7
|
-
|
8
|
-
contract = IB::Stock.new :symbol=> 'AAPL'
|
9
|
-
|
10
|
-
# First, connect to IB Gateway.
|
11
|
-
ib = IB::Connection.new :client_id => 1112 # id to identify your script
|
12
|
-
# :port => 7497 # TWS connection (instead of default Gateway)
|
13
|
-
# :received => false # Do not keep all received messages in memory
|
14
|
-
|
15
|
-
ib.subscribe(:Alert) { |msg| puts msg.to_human }
|
16
|
-
ib.subscribe(:MarketDataType) { |msg| puts msg.to_human }
|
17
|
-
ib.subscribe(:TickGeneric, :TickString, :TickPrice, :TickSize) { |msg| puts msg.inspect }
|
18
|
-
ib.send_message :RequestMarketDataType, :market_data_type => :delayed
|
19
|
-
ib.send_message :RequestMarketData, id: 123, contract: contract
|
20
|
-
|
21
|
-
puts "\nSubscribed to market data"
|
22
|
-
puts "\n******** Press <Enter> to cancel... *********\n\n"
|
23
|
-
gets
|
24
|
-
puts "Cancelling market data subscription.."
|
25
|
-
|
26
|
-
ib.send_message :CancelMarketData, id: 123
|
27
|
-
sleep 1
|
28
|
-
puts "Done."
|