Summary
In src/api/enhanced_strategy_recommender.py, _create_covered_call() computes max profit and max loss by adding a per-share option premium to 100-share dollar quantities. The premium is not scaled by the 100-share contract multiplier, so both figures are wrong by roughly the premium times 99.
Location
premium = self._get_option_price(call_option, 'bid') # per share, e.g. $2.50
max_profit = premium + (strike - current_price) * 100 # premium should be * 100
max_loss = (current_price * 100) - premium # premium should be * 100
premium is a per-share option price. (strike - current_price) * 100 and current_price * 100 are total dollar amounts for the 100 shares a covered call is written against. Adding an unscaled per-share premium to those totals is a unit mismatch.
Impact
Fix direction
Scale the premium to the contract (100 shares) so all terms are in total dollars:
max_profit = (premium + strike - current_price) * 100
max_loss = (current_price - premium) * 100
(Equivalently, keep everything per share and divide the other terms by 100. Either is fine as long as the units are consistent.)
Summary
In
src/api/enhanced_strategy_recommender.py,_create_covered_call()computes max profit and max loss by adding a per-share option premium to 100-share dollar quantities. The premium is not scaled by the 100-share contract multiplier, so both figures are wrong by roughly the premium times 99.Location
premiumis a per-share option price.(strike - current_price) * 100andcurrent_price * 100are total dollar amounts for the 100 shares a covered call is written against. Adding an unscaled per-share premium to those totals is a unit mismatch.Impact
max_profitandmax_lossfor every covered call are off bypremium * 99(the premium is counted once per share instead of for all 100 shares).profit_risk_ratio = max_profit / max_lossis computed from these values, so the covered-call ranking inherits the error.BUGS_TO_FIX.md; this issue tracks it on GitHub.Fix direction
Scale the premium to the contract (100 shares) so all terms are in total dollars:
(Equivalently, keep everything per share and divide the other terms by 100. Either is fine as long as the units are consistent.)