Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviermilla committed May 4, 2024
2 parents ac7bc89 + ea08351 commit 616934a
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "InteractiveBrokers"
uuid = "f310f2d2-a263-11e8-3998-47bd686f18f7"
authors = ["Luca Billi <[email protected]>", "Olivier Milla <[email protected]>"]
version = "0.20.6"
version = "0.21.0"

[deps]
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
Expand Down
2 changes: 1 addition & 1 deletion src/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const HEADTYPE = UInt32 # sizeof(HEADTYPE) == 4 bytes
const MAX_LEN = 0xffffff


isascii(m, d) = all(<(0x80), Iterators.drop(m, d))
isascii(m, d) = reduce(|, Iterators.drop(m, d)) < 0x80


function write_one(socket, buf)
Expand Down
4 changes: 4 additions & 0 deletions src/process.jl
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ const process = Dict(

ver Client.CUSTOMER_ACCOUNT && (o.customerAccount = pop(it))

ver Client.PROFESSIONAL_CUSTOMER && (o.professionalCustomer = pop(it))

w.openOrder(o.orderId, c, o, os)
end,

Expand Down Expand Up @@ -1036,6 +1038,8 @@ const process = Dict(

ver Client.CUSTOMER_ACCOUNT && (o.customerAccount = pop(it))

ver Client.PROFESSIONAL_CUSTOMER && (o.professionalCustomer = pop(it))

w.completedOrder(c, o, os)
end,

Expand Down
8 changes: 7 additions & 1 deletion src/requests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ function placeOrder(ib::Connection, id::Int, contract::Contract, order::Order)

ib.version Client.CUSTOMER_ACCOUNT && o(order.customerAccount)

ib.version Client.PROFESSIONAL_CUSTOMER && o(order.professionalCustomer)

sendmsg(ib, o)
end

Expand Down Expand Up @@ -374,7 +376,9 @@ 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, customerAccount::String)
function exerciseOptions(ib::Connection, tickerId::Int, contract::Contract, exerciseAction::Int,
exerciseQuantity::Int, account::String, override::Int, manualOrderTime::String,
customerAccount::String, professionalCustomer::Bool)

o = enc()

Expand All @@ -390,6 +394,8 @@ function exerciseOptions(ib::Connection, tickerId::Int, contract::Contract, exer

ib.version Client.CUSTOMER_ACCOUNT && o(customerAccount)

ib.version Client.PROFESSIONAL_CUSTOMER && o(professionalCustomer)

sendmsg(ib, o)
end

Expand Down
3 changes: 2 additions & 1 deletion src/types_mutable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ mutable struct Order
midOffsetAtWhole::Union{Float64,Nothing}
midOffsetAtHalf::Union{Float64,Nothing}
customerAccount::String
professionalCustomer::Bool
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,
Expand All @@ -179,7 +180,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)..., ns)
fill(nothing, 5)..., ns, false)


mutable struct ScannerSubscription
Expand Down
1 change: 1 addition & 0 deletions src/versions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
OPEN_ORDER_AD_STRATEGY = 181
LAST_TRADE_DATE = 182
CUSTOMER_ACCOUNT = 183
PROFESSIONAL_CUSTOMER = 184

end
6 changes: 3 additions & 3 deletions src/wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -380,17 +380,17 @@ function simple_wrap()

historicalTicks= function(reqId::Int, ticks::Dict, done::Bool)
d[:historyticks] = ticks
println("historicalTicks: $reqId $done")
println("historicalTicks: $reqId $done $(size(ticks))")
end,

historicalTicksBidAsk= function(reqId::Int, ticks::Dict, done::Bool)
d[:historyticksbidask] = ticks
println("historicalTicksBidAsk: $reqId $done")
println("historicalTicksBidAsk: $reqId $done $(size(ticks))")
end,

historicalTicksLast= function(reqId::Int, ticks::Dict, done::Bool)
d[:historytickslast] = ticks
println("historicalTicksLast: $reqId $done")
println("historicalTicksLast: $reqId $done $(size(ticks))")
end,

tickByTickAllLast= (reqId::Int, tickType::Int, time::Int, price::Float64, size::Float64, attribs::TickAttribLast, exchange::String, specialConditions::String) ->
Expand Down

0 comments on commit 616934a

Please sign in to comment.