I'm trying to select option contracts to trade based on their delta. According to this discussion, option greeks should be fairly similar to what's displayed in major brokerages (TD, IBKR).

In this backtest, I'm logging the strike prices chosen by the algo, which should be close to 0.20 delta. Sometimes it's close, others WAY off. For example, on Nov 15, 2022 the algo chose the 462.00C strike when SPY's price was 396.50.. According to ThinkorSwim, that's actually a 0.01 delta.

I'm using option.PriceModel = OptionPriceModels.BjerksundStensland() but am convinced there must be an inconsistency with the way option delta is being calculated?? This can be the only explanation as to why chosen strikes vary so much. I would love to be proven wrong.

Side note: I also noticed on this same day, the algo chose an expiration cycle with 31 DTE, despite option.SetFilter being set between timedelta(45), timedelta(65). 

I am selecting a contract by delta, retrieving it's strike price, so that I can then round to the nearest base 5 strike (more liquidity for trading) which makes the issue a bit more complicated. I'm a novice at Python, but hopefully this was at least implemented correctly.

Please forgive the half-baked code, this is supposed to be an iron condor but I only made it as far as the short call :)