Skip to content

Commit

Permalink
Update to API v169
Browse files Browse the repository at this point in the history
  • Loading branch information
lbilli committed Mar 15, 2022
1 parent 8a13bf1 commit a19abe4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 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.14.7"
version = "0.15.0"

[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand Down
14 changes: 13 additions & 1 deletion src/requests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,22 @@ function placeOrder(ib::Connection, id::Int, contract::Contract, order::Order)

ib.version Client.ADVANCED_ORDER_REJECT && o(order.advancedErrorOverride)

ib.version Client.MANUAL_ORDER_TIME && o(order.manualOrderTime)

sendmsg(ib, o)
end

cancelOrder(ib::Connection, id::Int) = req_simple(ib, 4, 1, id) ### CANCEL_ORDER
function cancelOrder(ib::Connection, id::Int, manualOrderCancelTime::String)

o = enc()

o(4, 1, ### CANCEL_ORDER
id)

ib.version Client.MANUAL_ORDER_TIME && o(manualOrderCancelTime)

sendmsg(ib, o)
end

reqOpenOrders(ib::Connection) = req_simple(ib, 5, 1) ### REQ_OPEN_ORDERS

Expand Down
3 changes: 2 additions & 1 deletion src/types_mutable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ mutable struct Order
duration::Union{Int,Nothing}
postToAts::Union{Int,Nothing}
advancedErrorOverride::String
manualOrderTime::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,
Expand All @@ -169,7 +170,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, nothing, ns)
false, ns, false, false, nothing, nothing, nothing, nothing, ns, ns)


mutable struct ScannerSubscription
Expand Down
2 changes: 2 additions & 0 deletions src/versions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
HISTORICAL_SCHEDULE = 165
ADVANCED_ORDER_REJECT = 166
USER_INFO = 167
CRYPTO_AGGREGATED_TRADES = 168
MANUAL_ORDER_TIME = 169

end

0 comments on commit a19abe4

Please sign in to comment.