I bought option historical data. When I do backtest, I need to calculate implied volatility and Greeks. The problem is that in option price formula, it needs interest rates and dividends, which is too complex to obtain for each stock. If I assume rate and dividend are zero, does it affect option strategies like butterfly and vertical spread?
I would simply take for both values zero (or other constants like r=2% and q=0%) for all tickers. As long as one does not make cross-ticker comparisions, then it should suffice, IMO. You can just try-out some different values to see whether it affects the results for the said strategies. I guess it will not significantly affect the result. Another option is to buy a dataset that already has all these values calculated. But IMO: if possible, better do it yourself by first "fixing" the raw data... (ie. the unrealistic Bid/Ask prices by the MMs, if present)
you can estimate the interest rate by time period and tenor. (Pre-2022, r=0, post 2022 r=5). For divs you can price the forward and back out the div (or both the rate and the div as 1 Number). It might matter depending on the options you look at (tenor and deltaness)
What Option Data do you have? I am still struggling to decide what option data (strikes, tenure etc) I should get..
Yahoo finance has downloadable, historical interest rates. https://finance.yahoo.com/quote/^IRX/history?p=^IRX
ORATS has IV, interest rates, hard to borrow rates, greeks and dividend yields. You need to know this in order to run a solid backtest. We also run millions of backtests using our data.
With stocks, the interest rate is a complicated issue: it also includes (ie. covers, contains) the Earnings Yield of the company, aka "drift" in academic literature. See also paper "Drift and the Risk-Free Rate". But I think taking r = max(RFR, EY) is the better method. See also https://quant.stackexchange.com/questions/8247/why-drifts-are-not-in-the-black-scholes-formula
you know there is an old saying "past performance does not guarantee future results", so long you understand how options and vol are priced, delta and gamma are good enough to make trading decisions. AND not guarantee you can make money.