Releases: tastyware/tastytrade
Release list
v13.2.3
What's Changed
tastytrade.utils.get_third_friday(and its dependentget_tasty_monthly) now takes into account market holidays and may return a Thursday instead- Added types
OCCandDXFtotastytrade.instrumentswhich can be used to annotate expected symbology (in the future could be used with Pydantic for validation also)
Full Changelog: v13.2.2...v13.2.3
v13.2.2
What's Changed
- Fix bug where some iterables that were valid according to SDK types (eg
set) could still get rejected by the API get_tasty_monthly()accepts arbitrary starting date (still defaults to today)
Full Changelog: v13.2.1...v13.2.2
v13.2.1
What's Changed
- Deprecate
tastytrade.paper.PaperAlertStreamer(use normalAlertStreamerinstead) PaperSessionnow checks the environment variableTW_API_KEYif an API key isn't provided
Full Changelog: v13.2.0...v13.2.1
v13.2.0
What's Changed
- Wait for confirmation after subscribing in
AlertStreamer: previously, a race condition was possible after sending the subscribe message but before the server received it. This could cause missed messages after callingAlertStreamer.subscribe_accounts(), for example. Now the subscription functions wait for confirmation from the server before returning. If confirmation isn't received within 10 seconds, the streamer crashes with a timeout, similar toDXLinkStreamer. - Server errors in
AlertStreamerare now raised instead of ignored, so instead of failing silently users can see what happened. This is a breaking change, but it only breaks code that was already silently broken.
Full Changelog: v13.1.0...v13.2.0
v13.1.0
v13.0.2
What's Changed
- Fix incorrect models for complex orders leading to missing attributes
Full Changelog: v13.0.1...v13.0.2
v13.0.1
v13.0.0
What's Changed
-
Better typing for order placement and response classes by @Graeme22 in #342, fixes #337
Introduces dedicated order classes per order type and uses them to overloadplace_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:
- Simple orders:
LimitOrder,MarketOrder,StopOrder,StopLimitOrder,NotionalOrder - Complex orders:
OCOOrder,OTOOrder,OTOCOOrder
New response models:
PlacedOrderResponseandPlacedComplexOrderResponseare now generic over order type (so placing aLimitOrderreturnsPlacedOrderResponse[PlacedLimitOrder]where price is of typeDecimalinstead ofDecimal | Noneas before).- Dry runs now return
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:
- Order
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 #337)- Dry runs return
UnplacedOrder(which has noidfield) instead ofid = -1. PlacedComplexOrder.typeis nowComplexOrderTypeinstead of a simple string.
Code that previously looked like this:
order = NewOrder(order_type=OrderType.LIMIT, legs=[leg], price=Decimal('-10')) response = await account.place_order(session, order, dry_run=False) reveal_type(response.order.price) # Decimal | None
Becomes:
order = LimitOrder(legs=[leg], price=Decimal('-10')) response = await account.place_order(session, order, dry_run=False) reveal_type(response.order.price) # Decimal
This allows for inferring all sorts of useful fields, eg
stop_triggerfor aPlacedStopOrder,trigger_orderfor aPlacedOTOCO, noidfor anUnplacedOrder(dry run). - Simple orders:
-
Remove deprecated
ssl_contextparameter fromDXLinkStreamer(can passverify=TruetoSession.client_kwargsinstead)
Full Changelog: v12.4.3...v13.0.0
v12.4.3
v12.4.2
What's Changed
- Fix a race condition in streamer setup that could occasionally kill the streamer (fixes #339)
- Update CONTRIBUTING.md by @Graeme22 in #340
- Make
MarketSessionSnapshot.close_atoptional (fixes #296)
Full Changelog: v12.4.1...v12.4.2