Giter Site home page Giter Site logo

Comments (9)

WinesProof avatar WinesProof commented on July 28, 2024

I tried looking at the web requests for this in a browser. If I enter that symbol in the quote bar at the bottom of the webpage, it says "Please enter a valid symbol." If I enter that symbol on the All-In-One Trade Ticket page, it says "Quotes are unavailable. Only limit/stop limit orders are accepted." and "This account is not approved to trade options." This is not surprising, since I never had any reason to get approved to trade options in my Schwab accounts. So I may not be able to help debug this. I even tried changing the AccountRegType from S1 to S3 with no change in the result.

Coincidentally, the internal browser request to the relevant url returns 500: InternalServerError "Server Error - Error while getting quotes", which is similar to the error message returned from the code that you posted in the other thread.

What happens when you try getting this quote in the All-In-One Trade Ticket on the webpage? Do you perhaps only have one account approved for options? In that case, maybe the request would need to be sure to specify that account. Just throwing out ideas.

from schwab-api.

dougbrowning avatar dougbrowning commented on July 28, 2024

Thanks a lot. This was working before he changed the code to _V2 so I think it is the code and not my account.

from schwab-api.

WinesProof avatar WinesProof commented on July 28, 2024

I eventually found the place on the website other than the order ticket that retrieves options quotes using the same endpoint/url as the code (Research -> Options, enter a symbol on that page, click on Options just below that entry box, then click on a particular bid or ask). There I noticed that their request uses three spaces between SPY and the option specification. I tried that, and it works for me regardless of my options access (and with any different number of spaces it fails with the same error that you received regardless of my options access):
api.quote_v2(["SPY 240216C00475000"])

After some additional trial and error, it looks like the option specification must start at the seventh character with spaces in between, i.e.:
api.quote_v2(["F 240216C00012000"])
api.quote_v2(["TSLA 240216C00255000"])

from schwab-api.

dougbrowning avatar dougbrowning commented on July 28, 2024

Yes that is what I had. As I keep testing it sometimes brings me back a quote and sometimes I just get this. Well pretty much it works the first run then stops working and I just get back blank.

from
quotes = api.quote_v2(["SPY 231226C00475000"])
pprint.pprint(quotes)
I get
([''], False)

from schwab-api.

WinesProof avatar WinesProof commented on July 28, 2024

The code you pasted does not have three species between SPY and 231226C00475000, so it's not clear that you tried what I suggested.

If your comments aren't preserving your exact code, it would be helpful if you would double check those as you post so we can figure this out.

from schwab-api.

dougbrowning avatar dougbrowning commented on July 28, 2024

Yes looks like it removed the extra spaces. It is exactly 3. It worked the first try then stops.
image
quotes = api.quote_v2(["SPY 231226C00475000"]) #quotes = api.quote_v2(["SPY"]) pprint.pprint(quotes)

from schwab-api.

WinesProof avatar WinesProof commented on July 28, 2024

Strange. I'm unable to reproduce any errors with api.quote_v2(["SPY 231226C00475000"]), even with repeated calls. I've tried calling it in a for loop with a delay, in a for loop without a delay, and several times in an IPython session. I tried with a fresh install of v0.3.5 in a fresh miniconda python 3.12 environment, as well as in a python 3.9 environment that has a variety of other packages installed.

Sorry I couldn't help.

from schwab-api.

dougbrowning avatar dougbrowning commented on July 28, 2024

Ok I think i see what is going on it is getting back only my roth ira now and not both my accounts in the login like it was before.
Any ideas how to fix that?
account_info = api.get_account_info()
pprint.pprint(account_info)

from schwab-api.

4rumprom avatar 4rumprom commented on July 28, 2024

Not sure if that is part of the problem but the call option you posted initially was with expiration on december 19th 2023 and you posted on december 22 2023. By then, the option call already expired.

from schwab-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.