-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option Chain Parse failure from getOptionChain() #40
Comments
hi @bosohn I just tried this using this branch of an example here and it worked. Just add your client id and refresh token to src/main/resources/tda-api.properties file then run I can attach the output if you want, but the point is that it didn't have an issue using the version in this pom (2.4.0). |
Hi, It works fine for other symbols but there are certain symbols that fails with the exception. For OSTK this time, I got For INO, I get correct response Somehow it consistently fails for some symbols and works for others. |
Can you check out the project and then build it with mvn clean install? It will install a SNAPSHOT version into your local repository. Then in your own project make sure you are using that SNAPSHOT version by updating your pom or Gradle build file or whatever you are using.
I think maybe you’re not using the latest version.
…On Tue, Feb 9, 2021, at 22:30, bosohn wrote:
Hi,
It works fine for other symbols but there are certain symbols that fails with the exception.
I tried SRNE and got
java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.math.BigDecimal` from String "NaN": not a valid representation
at [Source: (BufferedInputStream); line: 1, column: 309603] (through reference chain: com.studerw.tda.model.option.OptionChain["callExpDateMap"]->java.util.LinkedHashMap["2022-01-21:346"]->java.util.LinkedHashMap["1.0"]->java.util.ArrayList[0]->com.studerw.tda.model.option.Option["volatility"])
For OSTK this time, I got
java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `com.studerw.tda.model.account.OptionDeliverable$AssetType` from String "STOCK": not one of the values accepted for Enum class: [MUTUAL_FUND, CURRENCY, INDEX, FIXED_INCOME, OPTION, CASH_EQUIVALENT, EQUITY]
at [Source: (BufferedInputStream); line: 1, column: 441577] (through reference chain: com.studerw.tda.model.option.OptionChain["putExpDateMap"]->java.util.LinkedHashMap["2022-01-21:346"]->java.util.LinkedHashMap["2.5"]->java.util.ArrayList[1]->com.studerw.tda.model.option.Option["optionDeliverablesList"]->java.util.ArrayList[1]->com.studerw.tda.model.account.OptionDeliverable["assetType"])
For INO, I get correct response
Option Chain: ***@***.***[
symbol=INO
status=SUCCESS
underlying=
strategy=SINGLE
interval=0.0
isDelayed=false
isIndex=false
daysToExpiration=0.0
interestRate=0.1
underlyingPrice=13.825
volatility=29.0
***@***.***[
putCall=CALL
symbol=INO_021221C2
description=INO Feb 12 2021 2 Call (Weekly)
exchangeName=OPR
....
Somehow it consistently fails for some symbols and works for others.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#40 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABQHJAZDDLG7RWLSWIKSKW3S6H4XFANCNFSM4XLU7EVA>.
|
I just tried again with that same branch using all three of the symbols you listed and it works fine. I also deleted all the saved artifacts for this client in my ~/.m2/repository/com/studerw/ directory to force a download of the 2.4.0 version from Maven Central. Again, I think you are using a bad version somehow. Do you want to check in your project (without any token / client_id) stuff, of course? I can take a look. I will try it again a few more times during the day - maybe it's just an issue when prices are at a certain level, but I don't think that's it. |
Sorry, I've been busy. I will get back to it over the weekend. I appreciate your help and thanks for the nice software. Just wanted to ask you whether there's any TD API that provides earning dates and ex-dividend dates. I tried instrument info API from your API but it didn't return those information, also wondering whether there's an example on how to place spread or synthetic option order with multiple legs. |
I verified that it works fine with 2.4.0. Thanks for your help. Any information on the items I mentioned above for API? |
One more question: When I retrieve option chain 'underlyingPrice' field of OptionChain is often not valid as shown below for GLRE $4.25 (retrieved after market close today) while today's close is $7.86. For some symbols underlying price is $0.
{"delayed":false,"index":false,"symbol":"GLRE","status":"SUCCESS","strategy":"SINGLE","interval":0.0,"isDelayed":false,"isIndex":false,"daysToExpiration":0.0,"interestRate":0.1,"underlyingPrice":4.25,"volatility":29.0,"callExpDateMap":{"2021-02-19:1":{"2.5":[{"inTheMoney":true,"mini":false,"nonStandard":false,"putCall":"CALL","symbol":"GLRE_021921C2.5","description":"GLRE Feb 19 2021 2.5 Call","exchangeName":"OPR","bidPrice":4.5,"askPrice":6.6,"lastPrice":0.0,"bidAskSize":"80X20","markPrice":5.55,"bidSize":80,"askSize":20,"lastSize":0,"highPrice":0.0, |
Hi,
I am getting the following exception from getOptionChain() when I issued it today for OSTK. Could you please check this issue? I just tested with 2.4.0. If you cannot reproduce with OSTK, I can try to find other symbol that has the same issue.
com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type
java.math.BigDecimal
from String "NaN": not a valid representationat [Source: (BufferedInputStream); line: 1, column: 681] (through reference chain: com.studerw.tda.model.option.OptionChain["putExpDateMap"]->java.util.LinkedHashMap["2021-02-12:3"]->java.util.LinkedHashMap["46.0"]->java.util.ArrayList[0]->com.studerw.tda.model.option.Option["volatility"])
Thank you!
The text was updated successfully, but these errors were encountered: