diff --git a/Project.toml b/Project.toml index 24de493..857a2d3 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "InteractiveBrokers" uuid = "f310f2d2-a263-11e8-3998-47bd686f18f7" authors = ["Luca Billi ", "Olivier Milla "] -version = "0.20.5" +version = "0.20.6" [deps] Sockets = "6462fe0b-24de-5631-8697-dd941f90decc" diff --git a/src/process.jl b/src/process.jl index fb1af18..eb249d8 100644 --- a/src/process.jl +++ b/src/process.jl @@ -272,6 +272,8 @@ const process = Dict( :midOffsetAtWhole, :midOffsetAtHalf), it) + ver ≥ Client.CUSTOMER_ACCOUNT && (o.customerAccount = pop(it)) + w.openOrder(o.orderId, c, o, os) end, @@ -1032,6 +1034,8 @@ const process = Dict( :midOffsetAtWhole, :midOffsetAtHalf), it) + ver ≥ Client.CUSTOMER_ACCOUNT && (o.customerAccount = pop(it)) + w.completedOrder(c, o, os) end, diff --git a/src/requests.jl b/src/requests.jl index e884ccc..8e667d8 100644 --- a/src/requests.jl +++ b/src/requests.jl @@ -249,6 +249,8 @@ function placeOrder(ib::Connection, id::Int, contract::Contract, order::Order) order.midOffsetAtHalf) end + ib.version ≥ Client.CUSTOMER_ACCOUNT && o(order.customerAccount) + sendmsg(ib, o) end @@ -372,7 +374,7 @@ function reqHistoricalData(ib::Connection, tickerId::Int, contract::Contract, en sendmsg(ib, o) end -function exerciseOptions(ib::Connection, tickerId::Int, contract::Contract, exerciseAction::Int, exerciseQuantity::Int, account::String, override::Int, manualOrderTime::String) +function exerciseOptions(ib::Connection, tickerId::Int, contract::Contract, exerciseAction::Int, exerciseQuantity::Int, account::String, override::Int, manualOrderTime::String, customerAccount::String) o = enc() @@ -386,6 +388,8 @@ function exerciseOptions(ib::Connection, tickerId::Int, contract::Contract, exer ib.version ≥ Client.MANUAL_ORDER_TIME_EXERCISE_OPTIONS && o(manualOrderTime) + ib.version ≥ Client.CUSTOMER_ACCOUNT && o(customerAccount) + sendmsg(ib, o) end diff --git a/src/types_mutable.jl b/src/types_mutable.jl index 4a600de..e103d3a 100644 --- a/src/types_mutable.jl +++ b/src/types_mutable.jl @@ -167,6 +167,7 @@ mutable struct Order competeAgainstBestOffset::Union{Float64,Nothing} midOffsetAtWhole::Union{Float64,Nothing} midOffsetAtHalf::Union{Float64,Nothing} + customerAccount::String 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, @@ -178,7 +179,7 @@ Order() = Order(0, 0, 0, ns, 0, ns, nothing, nothing, ns, ns, ns, ns, 0, ns, tru fill(nothing, 4)..., 0, nothing, [], false, false, ns, SoftDollarTier(), nothing, ns, ns, ns, ns, false, false, false, ns, nothing, nothing, false, ns, false, false, fill(nothing, 4)..., ns, ns, - fill(nothing, 5)...) + fill(nothing, 5)..., ns) mutable struct ScannerSubscription diff --git a/src/versions.jl b/src/versions.jl index 33f957a..a766462 100644 --- a/src/versions.jl +++ b/src/versions.jl @@ -7,5 +7,6 @@ MANUAL_ORDER_TIME_EXERCISE_OPTIONS = 180 OPEN_ORDER_AD_STRATEGY = 181 LAST_TRADE_DATE = 182 + CUSTOMER_ACCOUNT = 183 end