Closed dougbrowning closed 11 months ago
Yes, this should be doable, but it's not currently a priority. With the acquisition of TD Ameritrade, it seems the API has completely changed, so I'm updating existing functionality to the new API.
Afterwards, I think it should be straightforward enough to implement something like this
Thanks! I will try to help but still waiting on access to the new API. I signed up but heard nothing. Pretty pissed they yanked the rug with nothing in place to replace it. My code is totally dead now.
To clarify, when I say "new API", I mean reverse engineering the API that Schwab uses under-the-hood (which is in line with the original spirit of this package). You will not need access to the formal API in order to use this package.
Hi, I just pushed version 0.3.0, which includes a new "quote" function. Please give it a try and see if it works for your use case :)
Wow thanks how can I know what the syntax is? TD python was from td.client import TDClient put_quotes = TDSession.get_quotes(instruments=[putSymbol]) currentPutPrice = put_quotes[putSymbol]['askPrice']
On my phone so just copying the code verbatim from the README:
import pprint
# Initialize our schwab instance
api = Schwab()
# Login using playwright
print("Logging into Schwab")
logged_in = api.login(
username=username,
password=password,
totp_secret=totp_secret # Get this by generating TOTP at https://itsjafer.com/#/schwab
)
# Get information about a few tickers
quotes = api.quote(["PFE", "AAPL"])
pprint.pprint(quotes)```
Thanks I got it working for stocks! But it is failing on option quotes. TD the format was weird using SPY_071221P435. I also tried .SPY231213C464 from TOS. Any idea what the format for options are?
thanks so much! so close!
For some reason, the Schwab format has 3 arbitrary spaces:
"SPY 231213C00470000"is the format that I'm seeing under the hood
That works! Thanks a lot. I have a fair amount to recode but will lyk. thanks so much
Well on to the next issue. The token times out in about 2 mins "invalid_token"}']. In the TD API it would auto refresh that token.
Know anything on that?
thanks again
In the TD API I was using I was pulling ticker info like this call_quotes = TDSession.get_quotes(instruments=[callSymbol])
Then I could parse the results getting volume, bid/ask, etc. I am not seeing that listed anywhere for this API?
Trying to recreate my TD code that has been dialed in over 3 years and lost it all with the move to Schwab. Not cool.
thanks a lot