From 32e8e4feb4326a70e7a6424f18758beb1064fe1c Mon Sep 17 00:00:00 2001 From: lbilli Date: Wed, 2 Jun 2021 09:03:22 -0400 Subject: [PATCH] Update to API v160 --- Project.toml | 2 +- src/process.jl | 2 ++ src/requests.jl | 2 ++ src/types_mutable.jl | 3 ++- src/versions.jl | 1 + 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 314566f..5b30776 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Jib" uuid = "f310f2d2-a263-11e8-3998-47bd686f18f7" authors = ["Luca Billi "] -version = "0.12.1" +version = "0.12.2" [deps] DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" diff --git a/src/process.jl b/src/process.jl index 9323eb2..be3fee4 100644 --- a/src/process.jl +++ b/src/process.jl @@ -264,6 +264,8 @@ const process = Dict{Int,Function}( # TODO Use a Tuple instead? ver ≥ Client.DURATION && (o.duration = pop(it)) + ver ≥ Client.POST_TO_ATS && (o.postToAts = pop(it)) + w.openOrder(o.orderId, c, o, os) end, diff --git a/src/requests.jl b/src/requests.jl index 8954c77..5c682a2 100644 --- a/src/requests.jl +++ b/src/requests.jl @@ -230,6 +230,8 @@ function placeOrder(ib::Connection, id::Int, contract::Contract, order::Order) ib.version ≥ Client.DURATION && o(order.duration) + ib.version ≥ Client.POST_TO_ATS && o(order.postToAts) + sendmsg(ib, o) end diff --git a/src/types_mutable.jl b/src/types_mutable.jl index 4fa8990..d55bfa2 100644 --- a/src/types_mutable.jl +++ b/src/types_mutable.jl @@ -157,6 +157,7 @@ mutable struct Order parentPermId::Union{Int,Nothing} usePriceMgmtAlgo::Union{Bool,Nothing} duration::Union{Int,Nothing} + postToAts::Union{Int,Nothing} end Order() = Order(0, 0, 0, ns, 0, ns, nothing, nothing, ns, ns, ns, ns, 0, ns, true, 0, false, false, nothing, 0, false, false, ns, ns, ns, false, nothing, nothing, @@ -167,7 +168,7 @@ Order() = Order(0, 0, 0, ns, 0, ns, nothing, nothing, ns, ns, ns, ns, 0, ns, tru (;), (;), ns, false, false, false, ns, [], (;), 0, 0, false, 0, ns, ns, fill(nothing, 4)..., 0, nothing, [], false, false, ns, SoftDollarTier(), nothing, ns, ns, ns, ns, false, false, false, ns, nothing, nothing, - false, ns, false, false, nothing, nothing, nothing) + false, ns, false, false, nothing, nothing, nothing, nothing) mutable struct ScannerSubscription diff --git a/src/versions.jl b/src/versions.jl index b6392f9..fe1458b 100644 --- a/src/versions.jl +++ b/src/versions.jl @@ -5,5 +5,6 @@ REPLACE_FA_END = 157 DURATION = 158 MARKET_DATA_IN_SHARES = 159 + POST_TO_ATS = 160 end