IBREST2 | R Documentation |
Get data data from IB Client Portal API.
findata::DataAbstract
-> IBREST2
domain
Domain, by default localhost
port
Port, by default 5000
baseurl
Base url
new()
Create a new IBREST object.
IBREST2$new(domain = "localhost", port = 5000L, azure_storage_endpoint = NULL)
domain
Domain, by default localhost
port
Port, by default 5000
azure_storage_endpoint
Azure storage endpoint
A new 'IBREST' object.
ib_get()
IB GET object
IBREST2$ib_get( url = modify_url(self$baseurl, path = "v1/api/sso/validate"), query = NULL )
url
Url of GET endpoint.
query
Query of GET request.
GET response.
ib_post()
IB POST object
IBREST2$ib_post( url = modify_url(self$baseurl, path = "v1/api/tickle"), body = NULL )
url
Url of POST endpoint.
body
Body of POST request.
GET response.
get_api_spec()
Get IB REST API description.
IBREST2$get_api_spec()
JSON object with description.
get_unadjusted_market()
Get unadjusted market data.
IBREST2$get_unadjusted_market( conid, exchange = NULL, period = "5d", bar = "1h", outsideRth = TRUE, keep_nytime_10_16 = TRUE )
conid
Contract ID.
exchange
Exchange.
period
Period.
bar
Bar.
outsideRth
Data outside trading hours.
keep_nytime_10_16
If TRUE, timezone is changed to NY time and only trading hours kept.
Data table with unadjusted market data.
get_position()
Get portfolio positions.
IBREST2$get_position(account_id, con_id)
account_id
Account ID.
con_id
Contract id.
list object with info on positions.
buy_and_confirm()
Place order.
IBREST2$buy_and_confirm(account_id, order_body)
account_id
Account ID.
order_body
Body of POST request which place order.
list object with info on positions.
cancel_order()
Cancel order.
IBREST2$cancel_order(account_id, order_id)
account_id
Account ID.
order_id
Order id from Place orders endpoint result.
list object with info on positions.
get_portfolio_summary()
Portfolio summary.
IBREST2$get_portfolio_summary(account_id)
account_id
Account ID.
list object with info on podrtfolio summary.
clone()
The objects of this class are cloneable with this method.
IBREST2$clone(deep = FALSE)
deep
Whether to make a deep clone.
https://www.interactivebrokers.com/api/doc.html
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.