Skip to content

Commit

Permalink
Update to API v165
Browse files Browse the repository at this point in the history
  • Loading branch information
lbilli committed Dec 6, 2021
1 parent cf3656d commit 3d83e08
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: rib
Title: An R implementation of Interactive Brokers API
Version: 0.13.2
Version: 0.13.3
Authors@R: person("Luca", "Billi", email = "noreply.section+dev@gmail.com", role = c("aut", "cre"))
Description: A native R implementation of Interactive Brokers API.
It establishes a TCP connection to a server and handles
Expand Down
18 changes: 18 additions & 0 deletions R/Decoder.R
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,24 @@ Decoder <- R6::R6Class("Decoder",
WSH_EVENT_DATA= function(imsg) {

private$validate("wshEventData", imsg$pop(2L), no_names=TRUE)
},

HISTORICAL_SCHEDULE= function(imsg) {

reqId <- imsg$pop()
startDateTime <- imsg$pop()
endDateTime <- imsg$pop()
timeZone <- imsg$pop()

n <- Validator$i(imsg$pop())

sessions <- private$to_matrix(imsg, n, "HistoricalSession")

private$validate("historicalSchedule", reqId= reqId,
startDateTime= startDateTime,
endDateTime= endDateTime,
timeZone= timeZone,
sessions= sessions)
}
)
)
4 changes: 3 additions & 1 deletion R/IBWrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ IBWrap <- R6::R6Class("IBWrap",

wshMetaData= function(reqId, dataJson) warning("default implementation"),

wshEventData= function(reqId, dataJson) warning("default implementation")
wshEventData= function(reqId, dataJson) warning("default implementation"),

historicalSchedule= function(reqId, startDateTime, endDateTime, timeZone, sessions) warning("default implementation")
)
)
7 changes: 6 additions & 1 deletion R/IBWrapSimple.R
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ IBWrapSimple <- R6::R6Class("IBWrapSimple",
cat("wshMetaData:", reqId, dataJson, "\n"),

wshEventData= function(reqId, dataJson)
cat("wshEventData:", reqId, dataJson, "\n")
cat("wshEventData:", reqId, dataJson, "\n"),

historicalSchedule= function(reqId, startDateTime, endDateTime, timeZone, sessions) {
self$context$schedule <- sessions
cat("historicalSchedule:", reqId, startDateTime, endDateTime, timeZone, "\n")
}
)
)
3 changes: 2 additions & 1 deletion R/codes.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,5 @@ map_inbound <- c( "1" = "TICK_PRICE",
"102" = "COMPLETED_ORDERS_END",
"103" = "REPLACE_FA_END",
"104" = "WSH_META_DATA",
"105" = "WSH_EVENT_DATA")
"105" = "WSH_EVENT_DATA",
"106" = "HISTORICAL_SCHEDULE")
3 changes: 2 additions & 1 deletion R/constants.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ MIN_SERVER_VER_WSHE_CALENDAR <- 161L
MIN_SERVER_VER_AUTO_CANCEL_PARENT <- 162L
MIN_SERVER_VER_FRACTIONAL_SIZE_SUPPORT <- 163L
MIN_SERVER_VER_SIZE_RULES <- 164L
MIN_SERVER_VER_HISTORICAL_SCHEDULE <- 165L


MIN_CLIENT_VER <- 157L
MAX_CLIENT_VER <- MIN_SERVER_VER_SIZE_RULES
MAX_CLIENT_VER <- MIN_SERVER_VER_HISTORICAL_SCHEDULE
1 change: 1 addition & 0 deletions R/validate.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ generate_validator <- function()
"DepthMktDataDescription",
"FamilyCode",
"HistogramData",
"HistoricalSession",
"HistoricalTick",
"HistoricalTickBidAsk",
"HistoricalTickLast",
Expand Down
1 change: 1 addition & 0 deletions inst/data-raw/codes_signature.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,4 @@ completedOrdersEnd NA NA
replaceFAEnd i,c reqId,text
wshMetaData i,c reqId,dataJson
wshEventData i,c reqId,dataJson
historicalSchedule i,c,c,c,dHistoricalSession reqId,startDateTime,endDateTime,timeZone,sessions
1 change: 1 addition & 0 deletions inst/data-raw/codes_struct.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ PriceIncrement n,n lowEdge,incr
HistoricalTick c,n,n time,price,size
HistoricalTickBidAsk c,i,n,n,n,n time,mask,priceBid,priceAsk,sizeBid,sizeAsk
HistoricalTickLast c,i,n,n,c,c time,mask,price,size,exchange,specialConditions
HistoricalSession c,c,c startDateTime,endDateTime,refDate

0 comments on commit 3d83e08

Please sign in to comment.