Reference
ShinyBroker Objects
These objects are the building blocks that your application uses to work with important tasks like fetching market data or submitting a trade order.
Contract | All tradable assets – even stocks and currencies – are ‘contracts’. |
Market Data Functions
Request and receive live market data. Can be kept up-to-date as ongoing subscriptions.
start_historical_data_subscription | Reactively get historical data |
"Fetch" Functions
Use these functions to quickly query & receive data from IBKR. They create their own sockets, use them for the query, listen for the response to come back in blocking mode, and return the result, which is immediately available for use. Since these functions operate in a “one-off” or “synchronous” manner, they can’t be used to create persistent, continually-updated data subscriptions; in other words, you can’t call fetch_historical_data
with keepUpToDate = True
.
fetch_historical_data | Fetch historical data for a tradable asset |
fetch_matching_symbols | Fetch assets whose symbol loosely matches a pattern |
fetch_sec_def_opt_params | Fetch the option parameters for a security. |
Low-Level Request Messages
These functions process their inputs into packed binary data messages that you can send to a connected IBKR socket to instruct it to do something you’re interested in such as place an order, start or cancel a market data subscription, or simply request the current time.
req_contract_details | Create a contract details request string |
req_current_time | Create a request string for the current broker time |
req_market_data_type | Create a string for setting your session’s market data type |
req_matching_symbols | Create a request string for symbols that loosely match a pattern |
req_mkt_data | Create a market data request string |
cancel_mkt_data | Create a message to cancel an existing market data subscription by ID |
req_sec_def_opt_params | Create a request for the security-defined option parameters of a security |
req_ids | Create a request for the next valid numeric ID that can be used to |
req_historical_data | Create a request for the historical data of a financial instrument |
cancel_historical_data | Create a message that will cancel an existing historical data request. |