Skip to content

Releases: tastyware/tastytrade

v13.2.3

Choose a tag to compare

@Graeme22 Graeme22 released this 07 Aug 21:12

What's Changed

  • tastytrade.utils.get_third_friday (and its dependent get_tasty_monthly) now takes into account market holidays and may return a Thursday instead
  • Added types OCC and DXF to tastytrade.instruments which 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

Choose a tag to compare

@Graeme22 Graeme22 released this 27 Jul 23:25

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

Choose a tag to compare

@Graeme22 Graeme22 released this 24 Jul 20:15

What's Changed

  • Deprecate tastytrade.paper.PaperAlertStreamer (use normal AlertStreamer instead)
  • PaperSession now checks the environment variable TW_API_KEY if an API key isn't provided

Full Changelog: v13.2.0...v13.2.1

v13.2.0

Choose a tag to compare

@Graeme22 Graeme22 released this 16 Jul 20:01

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 calling AlertStreamer.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 to DXLinkStreamer.
  • Server errors in AlertStreamer are 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

Choose a tag to compare

@Graeme22 Graeme22 released this 14 Jul 21:28
2ac2246

What's Changed

Full Changelog: v13.0.2...v13.1.0

v13.0.2

Choose a tag to compare

@Graeme22 Graeme22 released this 14 Jul 17:00

What's Changed

  • Fix incorrect models for complex orders leading to missing attributes

Full Changelog: v13.0.1...v13.0.2

v13.0.1

Choose a tag to compare

@Graeme22 Graeme22 released this 13 Jul 22:18

What's Changed

  • Add missing instrument type for event contracts (#348)

Full Changelog: v13.0.0...v13.0.1

v13.0.0

Choose a tag to compare

@Graeme22 Graeme22 released this 03 Jul 18:46

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 overload place_order, place_complex_order, and replace_order for more precise return types. Previously every response came back as PlacedOrder/PlacedComplexOrder with 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:

    • PlacedOrderResponse and PlacedComplexOrderResponse are now generic over order type (so placing a LimitOrder returns PlacedOrderResponse[PlacedLimitOrder] where price is of type Decimal instead of Decimal | None as before).
    • Dry runs now return UnplacedOrder/UnplacedComplexOrder, which have no id field, replacing the old sentinel id = -1.
    • PlacedOCOOrder/PlacedOTOCOOrder expose take_profit/stop_loss properties to ease distinguishing orders in the response model.

    Breaking changes:

    • Order price_effect/value_effect fields replaced with a single wrap serializer that parses the sign out of price/value at serialization time.
    • MarketData.mark is now optional (see #337)
    • Dry runs return UnplacedOrder (which has no id field) instead of id = -1.
    • PlacedComplexOrder.type is now ComplexOrderType instead 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_trigger for a PlacedStopOrder, trigger_order for a PlacedOTOCO, no id for an UnplacedOrder (dry run).

  • Remove deprecated ssl_context parameter from DXLinkStreamer (can pass verify=True to Session.client_kwargs instead)

Full Changelog: v12.4.3...v13.0.0

v12.4.3

Choose a tag to compare

@Graeme22 Graeme22 released this 03 Jul 17:53
79e5e74

What's Changed

  • Make TimeAndSale.exchange_sale_conditions optional (#344) by @Graeme22 in #345
  • handle mixed data types (#343) by @Graeme22 in #346
    Fixes a bug where dxfeed would randomly change data delivery format, crashing the streamer.

Full Changelog: v12.4.2...v12.4.3

v12.4.2

Choose a tag to compare

@Graeme22 Graeme22 released this 24 Jun 18:50

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_at optional (fixes #296)

Full Changelog: v12.4.1...v12.4.2