Skip to content

Commit

Permalink
Update to API v152
Browse files Browse the repository at this point in the history
  • Loading branch information
lbilli committed Jun 17, 2019
1 parent cf24191 commit 90ba2c3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Jib"
uuid = "f310f2d2-a263-11e8-3998-47bd686f18f7"
authors = ["Luca Billi <[email protected]>"]
version = "0.6.0"
version = "0.6.1"

[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand Down
7 changes: 3 additions & 4 deletions src/process.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ function tagvalue2nt(x)

s = collect(String, x)

t = Tuple(Symbol.(s[1:2:end]))
v = Tuple(s[2:2:end])

NamedTuple{t}(v)
(; (Symbol(t) => v for (t, v) Iterators.partition(s, 2))...,)
end


Expand Down Expand Up @@ -338,6 +335,8 @@ const process = Dict{Int,Function}(

ver Client.REAL_EXPIRATION_DATE && (cd.realExpirationDate = pop(it))

ver Client.STOCK_TYPE && (cd.stockType = pop(it))

w.contractDetails(reqId, cd)
end,

Expand Down
3 changes: 2 additions & 1 deletion src/types_private.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ mutable struct ContractDetails
marketRuleIds::String
realExpirationDate::String
lastTradeTime::String
stockType::String
secIdList::NamedTuple
cusip::String
ratings::String
Expand All @@ -57,7 +58,7 @@ mutable struct ContractDetails
notes::String
end
ContractDetails() = ContractDetails(Contract(), ns, 0.0, ns, ns, 0, 0, fill(ns, 9)..., 0,
nothing, nothing, fill(ns, 5)..., NamedTuple(),
nothing, nothing, fill(ns, 6)..., NamedTuple(),
fill(ns, 5)..., false, false, 0, false, ns, ns, ns, ns,
false, ns)

Expand Down
1 change: 1 addition & 0 deletions src/versions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@
MKT_DEPTH_PRIM_EXCHANGE = 149
COMPLETED_ORDERS = 150
PRICE_MGMT_ALGO = 151
STOCK_TYPE = 152

end

0 comments on commit 90ba2c3

Please sign in to comment.