-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move IBWrapSimple to examples/
- Loading branch information
Showing
13 changed files
with
401 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
Package: rib | ||
Title: An R implementation of Interactive Brokers API | ||
Version: 0.17.2 | ||
Title: An Implementation of 'Interactive Brokers' API | ||
Version: 0.18.2 | ||
Authors@R: person("Luca", "Billi", email = "[email protected]", role = c("aut", "cre")) | ||
Description: A native R implementation of Interactive Brokers API. | ||
It establishes a TCP connection to a server and handles | ||
request-response message exchanges. | ||
Data is encoded and decoded between user and wire formats. Data strucures | ||
mirror what is found in the official API, which is available for other | ||
languages. | ||
Description: Allows interaction with 'Interactive Brokers' 'Trader Workstation' | ||
<https://interactivebrokers.github.io/tws-api/>. | ||
Handles the connection over the network and the exchange of messages. | ||
Data is encoded and decoded between user and wire formats. | ||
Data structures and functionality closely mirror the official implementations. | ||
Depends: | ||
R (>= 3.4.0) | ||
Import: | ||
R6 (>= 2.4.0) | ||
R (>= 3.4) | ||
Imports: | ||
R6 (>= 2.4) | ||
License: GPL-3 | ||
Encoding: UTF-8 | ||
LazyData: true | ||
URL: https://github.com/lbilli/rib/ | ||
BugReports: https://github.com/lbilli/rib/issues/ | ||
URL: https://github.com/lbilli/rib | ||
BugReports: https://github.com/lbilli/rib/issues |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# rib 0.18.2 | ||
|
||
* Submission to CRAN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
\name{IBClient} | ||
\alias{IBClient} | ||
\docType{class} | ||
|
||
\title{Client Connection Class} | ||
|
||
\description{ | ||
This is the main class that manages the connection with the | ||
'Trader Workstation', sends requests and handles responses. | ||
} | ||
|
||
\section{Methods}{ | ||
\itemize{ | ||
|
||
\item \code{IBClient$new()}: creates a new instance. | ||
|
||
\item \code{$connect(host="localhost", port, clientId, connectOptions="")}: | ||
connects to \code{host:port} and performs the initial | ||
handshake using client identifier \code{clientId} and additional | ||
options \code{connectOptions}. | ||
|
||
\item \code{$checkMsg(wrap, timeout=0.2)}: waits for and process server messages. | ||
When available, messages are decoded and handed over to the appropriate | ||
callback defined in \code{wrap}, which must be an instance of a child of | ||
\code{IBWrap}. | ||
If \code{wrap} is missing, messages are read and immediately discarded. | ||
Returns the number of messages processed. | ||
|
||
This methods \bold{blocks} up to \code{timeout} seconds. | ||
\bold{Needs to be called regularly}. | ||
|
||
\item \code{$disconnect()}: terminates the connection. | ||
} | ||
|
||
This class is modeled after the class \code{EClient} from the official IB API | ||
implementations. | ||
In addition to the methods shown above, several others exist that are used to send | ||
requests to the server. | ||
|
||
Refer to the official documentation for a comprehensive list of the possible | ||
requests, including their signatures and descriptions. | ||
} | ||
|
||
\seealso{ | ||
\code{\link{IBWrap}}. | ||
|
||
\href{https://interactivebrokers.github.io/tws-api/classIBApi_1_1EClient.html}{\code{EClient}} | ||
definition from the official documentation. | ||
} | ||
|
||
|
||
\examples{ | ||
\dontrun{ | ||
# Instantiate a wrapper | ||
wrap <- IBWrapSimple$new() | ||
|
||
# Create a client and connect to a server | ||
ic <- IBClient$new() | ||
ic$connect(port=4002, clientId=1) | ||
|
||
# Make a request | ||
stock <- IBContract(symbol="GOOG", secType="STK", exchange="SMART", currency="USD") | ||
ic$reqContractDetails(11, stock) | ||
|
||
# Process responses | ||
ic$checkMsg(wrap) | ||
|
||
# Disconnect | ||
ic$disconnect() | ||
} | ||
} |
Oops, something went wrong.