Skip to content
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

[Bug] Large Difference in Options Greeks Values Between Sources. #3779

Closed
deeleeramone opened this issue Dec 15, 2022 · 6 comments · Fixed by #3812
Closed

[Bug] Large Difference in Options Greeks Values Between Sources. #3779

deeleeramone opened this issue Dec 15, 2022 · 6 comments · Fixed by #3812
Labels
bug Fix bug

Comments

@deeleeramone
Copy link
Contributor

The two values are not even in the ballpark, for the same option.

Screenshot 2022-12-14 at 8 32 32 PM

@deeleeramone deeleeramone added the bug Fix bug label Dec 15, 2022
@deeleeramone
Copy link
Contributor Author

Another set of values are returned from greeks which are completely different.

Screenshot 2022-12-14 at 9 05 39 PM

@jmaslek
Copy link
Collaborator

jmaslek commented Dec 15, 2022

Another set of values are returned from greeks which are completely different.

Screenshot 2022-12-14 at 9 05 39 PM

This is expected when you consider put vs call. call delta - put delta is close to 1 for all those and the difference between the rest is consistent with IV diff.

The massive difference between sources is not and was supposed to be fixed with a recent PR. I have a hypothesis that I will test out.

@jmaslek
Copy link
Collaborator

jmaslek commented Dec 16, 2022

So I did find one bug. The chains command is still using .seconds instead of .total_seconds. That will have a large impact on the greeks shown via chains. And actually looking at this, the greeks from chains -source Tradier are close to greeks.

Do note IV varies between everywhere. At the time of writing, for 12/16 398 call for SPY has the following IV: .29 at tradier, .23 on nasdaq and .18 on yf). That will impact the calculations a whole lot.

When calculating, we can do better on the dte by adding 16 hours to the expiry date (since the option expires at 4pm), but this wont have a big impact since convert this to yearly yearly.

@deeleeramone
Copy link
Contributor Author

For the same call, after market close

YF: 0.2441481
Tradier: 0.290037
Nasdaq: This column does not exist.

@northern-64bit
Copy link
Contributor

Tradier:
We do no calculations it just retrieves the data from their api. So that one is correct unless Tradier calculates it wrongly.

YFinance:
For the calculations we currently use a fixed risk free rate at 0.03, which changes the results a bit. There's also the issue mentioned by @jmaslek that it uses seconds instead of total_seconds.

Nasdaq:
No calculations done on our side, just gets the data from the api (no greeks)

My pr #3812 should fix these mentioned issues.

@jmaslek
Copy link
Collaborator

jmaslek commented Dec 21, 2022

Tradier: We do no calculations it just retrieves the data from their api. So that one is correct unless Tradier calculates it wrongly.

YFinance: For the calculations we currently use a fixed risk free rate at 0.03, which changes the results a bit. There's also the issue mentioned by @jmaslek that it uses seconds instead of total_seconds.

Nasdaq: No calculations done on our side, just gets the data from the api (no greeks)

My pr #3812 should fix these mentioned issues.

Note I fixed the total seconds issue in #3792. The rf rate should probably be an input variable as well. Has a very small impact, as its an overall exp(-r*T)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fix bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants