alexgolec / tda-api

A TD Ameritrade API client for Python. Includes historical data for equities and ETFs, options chains, streaming order book data, complex order construction, and more.
https://tda-api.readthedocs.io
MIT License
1.26k stars 338 forks source link

Improper field label in stream client #312

Open alienbrett opened 2 years ago

alienbrett commented 2 years ago

When subscribing to futures options, it seems that tda-api is re-labelling stream messages incorrectly.

For example: 1) subscribe to receive level one futures option quotes for ticker "./OZFU22P113" (/ZFU22 is the underlyer) 2) examine API response

I see something like

{
    "key": "./OZFU22P113",
    "delayed": false,
    "BID_PRICE": 0.8047,
    "BID_SIZE": 715,
    "ASK_ID": 63,
    "BID_ID": 63,
    "QUOTE_TIME": 1653685200058,
    "CLOSE_PRICE": 0.8594,
    "EXCHANGE_ID": 63,
    "DESCRIPTION": "5-Year U.S. Treasury Note Options",
    "OPEN_PRICE": 1638,
    "NET_CHANGE": 6.3203,
    "FUTURE_PERCENT_CHANGE": 0.0078,
    "EXCHANGE_NAME": 7.8125,
    "SECURITY_STATUS": 1000,
    "OPEN_INTEREST": 0.8594,
    "MARK": "/ZFU22",
    "TICK": 113,
    "TICK_AMOUNT": 1661486400000
}

Clearly "MARK" column is swapped with the underlyer, and "OPEN_PRICE" and "EXCHANGE_NAME" are labelled wrong.

It's not clear to me what the proper labelling should be, but I thought I should make this known

alexgolec commented 2 years ago

Thanks for pointing this out, this is important to change.

Can you please provide some more information about this issue, most importantly demonstration code? Here's a listing of the information that would be most helpful:

https://tda-api.readthedocs.io/en/latest/help.html#provide-adequate-information