v13.0.0 #347
Graeme22
announced in
Announcements
v13.0.0
#347
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What's Changed
Better typing for order placement and response classes by @Graeme22 in Better typing for order placement and response classes #342, fixes ValidationError caused by the field mark in MarketData #337
Introduces dedicated order classes per order type and uses them to overload
place_order,place_complex_order, andreplace_orderfor more precise return types. Previously every response came back asPlacedOrder/PlacedComplexOrderwith many fields optional, forcing users to null-check fields that were always present for their order type.New order helpers:
LimitOrder,MarketOrder,StopOrder,StopLimitOrder,NotionalOrderOCOOrder,OTOOrder,OTOCOOrderNew response models:
PlacedOrderResponseandPlacedComplexOrderResponseare now generic over order type (so placing aLimitOrderreturnsPlacedOrderResponse[PlacedLimitOrder]where price is of typeDecimalinstead ofDecimal | Noneas before).UnplacedOrder/UnplacedComplexOrder, which have noidfield, replacing the old sentinelid = -1.PlacedOCOOrder/PlacedOTOCOOrderexposetake_profit/stop_lossproperties to ease distinguishing orders in the response model.Breaking changes:
price_effect/value_effectfields replaced with a single wrap serializer that parses the sign out of price/value at serialization time.MarketData.markis now optional (see ValidationError caused by the field mark in MarketData #337)UnplacedOrder(which has noidfield) instead ofid = -1.PlacedComplexOrder.typeis nowComplexOrderTypeinstead of a simple string.Code that previously looked like this:
Becomes:
This allows for inferring all sorts of useful fields, eg
stop_triggerfor aPlacedStopOrder,trigger_orderfor aPlacedOTOCO, noidfor anUnplacedOrder(dry run).Remove deprecated
ssl_contextparameter fromDXLinkStreamer(can passverify=TruetoSession.client_kwargsinstead)Full Changelog: v12.4.3...v13.0.0
This discussion was created from the release v13.0.0.
All reactions