studerw / td-ameritrade-client

TD Ameritrade Java Client
Apache License 2.0
69 stars 47 forks source link

Option Prices: repeated error on NAN instead of valid double #36

Closed higgsja closed 3 years ago

higgsja commented 3 years ago

Not on every symbol but for example: [main] INFO TDA_HTTP - RESPONSE [200 - OK]: https://api.tdameritrade.com/v1/marketdata/chains?symbol=AMZN in 236.1 ms [main] WARN com.studerw.tda.parse.BigDecimalNanDeserializer - volatility using invalid NAN instead of a valid double [main] WARN com.studerw.tda.parse.BigDecimalNanDeserializer - delta using invalid NAN instead of a valid double [main] WARN com.studerw.tda.parse.BigDecimalNanDeserializer - gamma using invalid NAN instead of a valid double [main] WARN com.studerw.tda.parse.BigDecimalNanDeserializer - theta using invalid NAN instead of a valid double [main] WARN com.studerw.tda.parse.BigDecimalNanDeserializer - rho using invalid NAN instead of a valid double [main] WARN com.studerw.tda.parse.BigDecimalNanDeserializer - theoreticalOptionValue using invalid NAN instead of a valid double [main] WARN com.studerw.tda.parse.BigDecimalNanDeserializer - volatility using invalid NAN instead of a valid double

studerw commented 3 years ago

Are you using the latest version 2.3.0?

higgsja commented 3 years ago

I think so as it is in the POM.

Is there a way to tell other than the version number there?

On Wed, Jan 6, 2021, 2:57 PM William Studer notifications@github.com wrote:

Are you using the latest version 2.3.0?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/studerw/td-ameritrade-client/issues/36#issuecomment-755683946, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZKGI6HB6XYUSIO6XL6S63SYTFDZANCNFSM4VYBPN5Q .

studerw commented 3 years ago

I just noticed. Those aren't really errors, they're just warning you that the JSON that's being returned is setting a bunch of JSON doubles back as the string NAN instead of 0 which they actually are, I believe (or some other number that can't be described such as -infinity). Either way, by the time the Java POJO is returned to you, those fields are set to 0, which is accurate as far as the API is concerned.

There was another issue that was kind of similar, and apparently TDA isn't going to fix it: https://github.com/studerw/td-ameritrade-client/issues/24

studerw commented 3 years ago

Going to close this, as I just tested Master with "AMZN" and it successfully returns the results.