ib-ruby 0.5.12 → 0.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/HISTORY +4 -0
- data/VERSION +1 -1
- data/lib/ib-ruby/connection.rb +4 -2
- data/lib/ib-ruby/messages/incoming.rb +27 -1
- data/lib/ib-ruby/models/order.rb +25 -1
- metadata +2 -2
data/HISTORY
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.13
|
data/lib/ib-ruby/connection.rb
CHANGED
@@ -182,13 +182,15 @@ module IB
|
|
182
182
|
log.warn "No subscribers for message #{msg.class}!" if subscribers[msg.class].empty?
|
183
183
|
end
|
184
184
|
|
185
|
-
# Place Order (convenience wrapper for message :PlaceOrder)
|
185
|
+
# Place Order (convenience wrapper for message :PlaceOrder).
|
186
|
+
# Returns TWS id of a placed order.
|
186
187
|
def place_order order, contract
|
188
|
+
@next_order_id += 1
|
187
189
|
send_message :PlaceOrder,
|
188
190
|
:order => order,
|
189
191
|
:contract => contract,
|
190
192
|
:id => @next_order_id
|
191
|
-
@next_order_id
|
193
|
+
@next_order_id
|
192
194
|
end
|
193
195
|
|
194
196
|
protected
|
@@ -98,7 +98,33 @@ module IB
|
|
98
98
|
end
|
99
99
|
|
100
100
|
### Actual message classes (short definitions):
|
101
|
-
|
101
|
+
#:status - String: Displays the order status. Possible values include:
|
102
|
+
# � PendingSubmit - indicates that you have transmitted the order, but
|
103
|
+
# have not yet received confirmation that it has been accepted by the
|
104
|
+
# order destination. NOTE: This order status is NOT sent back by TWS
|
105
|
+
# and should be explicitly set by YOU when an order is submitted.
|
106
|
+
# � PendingCancel - indicates that you have sent a request to cancel
|
107
|
+
# the order but have not yet received cancel confirmation from the
|
108
|
+
# order destination. At this point, your order cancel is not confirmed.
|
109
|
+
# You may still receive an execution while your cancellation request
|
110
|
+
# is pending. NOTE: This order status is not sent back by TWS and
|
111
|
+
# should be explicitly set by YOU when an order is canceled.
|
112
|
+
# � PreSubmitted - indicates that a simulated order type has been
|
113
|
+
# accepted by the IB system and that this order has yet to be elected.
|
114
|
+
# The order is held in the IB system until the election criteria are
|
115
|
+
# met. At that time the order is transmitted to the order destination
|
116
|
+
# as specified.
|
117
|
+
# � Submitted - indicates that your order has been accepted at the order
|
118
|
+
# destination and is working.
|
119
|
+
# � Cancelled - indicates that the balance of your order has been
|
120
|
+
# confirmed canceled by the IB system. This could occur unexpectedly
|
121
|
+
# when IB or the destination has rejected your order.
|
122
|
+
# � Filled - indicates that the order has been completely filled.
|
123
|
+
# � Inactive - indicates that the order has been accepted by the system
|
124
|
+
# (simulated orders) or an exchange (native orders) but that currently
|
125
|
+
# the order is inactive due to system, exchange or other issues.
|
126
|
+
# :why_held - This field is used to identify an order held when TWS is trying to
|
127
|
+
# locate shares for a short sell. The value used to indicate this is 'locate'.
|
102
128
|
OrderStatus = def_message 3, [:id, :int],
|
103
129
|
[:status, :string],
|
104
130
|
[:filled, :int],
|
data/lib/ib-ruby/models/order.rb
CHANGED
@@ -209,7 +209,31 @@ module IB
|
|
209
209
|
|
210
210
|
# Some Order properties (received back from IB) are separated into
|
211
211
|
# OrderState object. Here, they are lumped into Order proper: see OrderState.java
|
212
|
-
attr_accessor :status, # String: Displays the order status.
|
212
|
+
attr_accessor :status, # String: Displays the order status.Possible values include:
|
213
|
+
# � PendingSubmit - indicates that you have transmitted the order, but
|
214
|
+
# have not yet received confirmation that it has been accepted by the
|
215
|
+
# order destination. NOTE: This order status is NOT sent back by TWS
|
216
|
+
# and should be explicitly set by YOU when an order is submitted.
|
217
|
+
# � PendingCancel - indicates that you have sent a request to cancel
|
218
|
+
# the order but have not yet received cancel confirmation from the
|
219
|
+
# order destination. At this point, your order cancel is not confirmed.
|
220
|
+
# You may still receive an execution while your cancellation request
|
221
|
+
# is pending. NOTE: This order status is not sent back by TWS and
|
222
|
+
# should be explicitly set by YOU when an order is canceled.
|
223
|
+
# � PreSubmitted - indicates that a simulated order type has been
|
224
|
+
# accepted by the IB system and that this order has yet to be elected.
|
225
|
+
# The order is held in the IB system until the election criteria are
|
226
|
+
# met. At that time the order is transmitted to the order destination
|
227
|
+
# as specified.
|
228
|
+
# � Submitted - indicates that your order has been accepted at the order
|
229
|
+
# destination and is working.
|
230
|
+
# � Cancelled - indicates that the balance of your order has been
|
231
|
+
# confirmed canceled by the IB system. This could occur unexpectedly
|
232
|
+
# when IB or the destination has rejected your order.
|
233
|
+
# � Filled - indicates that the order has been completely filled.
|
234
|
+
# � Inactive - indicates that the order has been accepted by the system
|
235
|
+
# (simulated orders) or an exchange (native orders) but that currently
|
236
|
+
# the order is inactive due to system, exchange or other issues.
|
213
237
|
:init_margin, # String: Shows the impact the order would have on your
|
214
238
|
# initial margin.
|
215
239
|
:maint_margin, # String: Shows the impact the order would have on your
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ib-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.5.
|
5
|
+
version: 0.5.13
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Paul Legato
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2012-01-
|
14
|
+
date: 2012-01-03 00:00:00 +03:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|