itsjafer / schwab-api

A python library for placing trades on Charles Schwab
MIT License
201 stars 64 forks source link

Add order affirmation and some documentation on order return codes #37

Closed WinesProof closed 8 months ago

WinesProof commented 8 months ago

For some order types, Schwab wants to make extra sure that you meant to do what you're asking them to do. Examples include "marketable" limit orders (buy limit above ask, sell limit below bid) and buying some commodity ETFs (though I'm not seeing the need to do that for the ones I tried today, so maybe they relaxed things a bit).

To get these orders to execute, we have to provide an additional "OrderAffrmIn" entry in the execution request, and we also have to include additional valid_return_codes, so I added some documentation on ones I've seen.

itsjafer commented 8 months ago

Strongly appreciate your investigation here!