View source: R/req_auto_open_orders.R
req_auto_open_orders | R Documentation |
By default, orders placed within the TWS user interface are "unbound",
meaning that they have no order ID. req_auto_open_orders()
toggles
this behavior, allowing the user to configure TWS to assign IDs to new orders
cretaed from within the TWS or not.
req_auto_open_orders()
cannot be used on orders that are
already placed from the TWS. In other words, if you submit an order within
the TWS without having first called req_auto_open_orders()
, then that
order is mostly inaccessable by anything other than TWS.
Any API script or app that needs to access all orders placed – whether
within the TWS, via the API, or any other source – should call
req_auto_open_orders()
during initiation (or, if a script, near the
beginning) so that orders created by users in the TWS have an order ID, and
can therefore be accessible to be modified by place_order() and
canceled with cancel_order().
IB's documentation may be found on the Open Orders page.
req_auto_open_orders(bAutoBind = TRUE)
bAutoBind |
Logical, length 1, default TRUE. If TRUE, all subsequent orders created from within TWS will have an order ID (IB refers to orders having an ID as being "bound" in the documentation). If set to FALSE, future orders will not have an order ID ("unbound"). |
TWS client required: TWS will only bind newly opened orders so long
as the socket connected on clientId = 0
continues to be open. Closing
the TWS socket is equivalent to calling req_auto_open_orders(FALSE)
.
orderId =x= permId
: Although by default, orders created in
TWS have no orderId, they do have a permId. permId can
be used to identify an order, but cannot be used by the API to cancel or
modify it.
NULL, invisibly
Other orders:
cancel_order()
,
place_order()
,
req_all_open_orders()
,
req_completed_orders()
,
req_ids()
,
req_open_orders()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.