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

Issue with decimal strikes in OptionSymbol #344

Closed sanathnair09 closed 5 months ago

sanathnair09 commented 7 months ago

When using the api to place options trade I noticed that strike prices following the form x.x0 would not be sanitized to x.x. This caused the symbol to not be found and hence not place the order.

In this change I fixed the sanitation for the strike price to handle such cases and added a test case for this case.