Closed deeleeramone closed 1 year ago
Another set of values are returned from greeks
which are completely different.
Another set of values are returned from
greeks
which are completely different.
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.
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.
For the same call, after market close
YF: 0.2441481 Tradier: 0.290037 Nasdaq: This column does not exist.
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.
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)
The two values are not even in the ballpark, for the same option.