alexgolec / schwab-py

Unofficial API wrapper for the Schwab HTTP API
MIT License
184 stars 44 forks source link

Missing 5 Order Statuses #135

Closed codyfletcher closed 2 months ago

codyfletcher commented 3 months ago

Description of Bug

I place thousands of orders daily and have seen some of these statuses more than once. There are 5 new order statuses in the Schwab API that were not part of the TD Ameritrade API. Link to documentation (here), where it states we should expect the following statuses:

Current Order.Status Enum (in base.py)

Shows 15 statuses

    class Order:
        class Status(Enum):
            '''Order statuses passed to :meth:`get_orders_for_account` and
            :meth:`get_orders_for_all_linked_accounts`'''
            AWAITING_PARENT_ORDER = 'AWAITING_PARENT_ORDER'
            AWAITING_CONDITION = 'AWAITING_CONDITION'
            AWAITING_MANUAL_REVIEW = 'AWAITING_MANUAL_REVIEW'
            ACCEPTED = 'ACCEPTED'
            AWAITING_UR_OUT = 'AWAITING_UR_OUT'
            PENDING_ACTIVATION = 'PENDING_ACTIVATION'
            QUEUED = 'QUEUED'
            WORKING = 'WORKING'
            REJECTED = 'REJECTED'
            PENDING_CANCEL = 'PENDING_CANCEL'
            CANCELED = 'CANCELED'
            PENDING_REPLACE = 'PENDING_REPLACE'
            REPLACED = 'REPLACED'
            FILLED = 'FILLED'
            EXPIRED = 'EXPIRED'

**How to Reproduce***

If you want to use enums to get orders by status, you cannot get the new 6 statuses.

alexgolec commented 2 months ago

Thanks for pointing this out, you're right. I was working from this documentation when I originally added the enums, so it's possible they were added since I did the initial release.