{"slug":"covered-calls-on-aapl","qid":"ex_dividend_window","label":"AAPL dividend versus the time value left in the nearest in-the-money call, the day before each ex date","post_title":"Covered Calls on AAPL: A Worked Example","post_url":"/blog/covered-calls-on-aapl#q-ex_dividend_window","columns":["ex_date_iso","ex_pretty","dividend_usd","time_value_usd","strike","days_to_expiry","exercise_edge"],"rows":[{"ex_date_iso":"2021-11-05","ex_pretty":"November 5, 2021","dividend_usd":0.22,"time_value_usd":1.27,"strike":"150","days_to_expiry":"8","exercise_edge":"the time value was larger"},{"ex_date_iso":"2022-02-04","ex_pretty":"February 4, 2022","dividend_usd":0.22,"time_value_usd":1.6,"strike":"172.5","days_to_expiry":"8","exercise_edge":"the time value was larger"},{"ex_date_iso":"2022-05-06","ex_pretty":"May 6, 2022","dividend_usd":0.23,"time_value_usd":3.24,"strike":"157.5","days_to_expiry":"8","exercise_edge":"the time value was larger"},{"ex_date_iso":"2022-08-05","ex_pretty":"August 5, 2022","dividend_usd":0.23,"time_value_usd":2.06,"strike":"165","days_to_expiry":"8","exercise_edge":"the time value was larger"},{"ex_date_iso":"2022-11-04","ex_pretty":"November 4, 2022","dividend_usd":0.23,"time_value_usd":3.67,"strike":"137","days_to_expiry":"8","exercise_edge":"the time value was larger"},{"ex_date_iso":"2023-02-10","ex_pretty":"February 10, 2023","dividend_usd":0.23,"time_value_usd":2.44,"strike":"150","days_to_expiry":"8","exercise_edge":"the time value was larger"},{"ex_date_iso":"2023-05-12","ex_pretty":"May 12, 2023","dividend_usd":0.24,"time_value_usd":1.37,"strike":"172.5","days_to_expiry":"8","exercise_edge":"the time value was larger"},{"ex_date_iso":"2023-08-11","ex_pretty":"August 11, 2023","dividend_usd":0.24,"time_value_usd":1.52,"strike":"177.5","days_to_expiry":"8","exercise_edge":"the time value was larger"},{"ex_date_iso":"2023-11-10","ex_pretty":"November 10, 2023","dividend_usd":0.24,"time_value_usd":1.2,"strike":"180","days_to_expiry":"8","exercise_edge":"the time value was larger"},{"ex_date_iso":"2024-02-09","ex_pretty":"February 9, 2024","dividend_usd":0.24,"time_value_usd":1.79,"strike":"187.5","days_to_expiry":"8","exercise_edge":"the time value was larger"},{"ex_date_iso":"2024-05-10","ex_pretty":"May 10, 2024","dividend_usd":0.25,"time_value_usd":0.86,"strike":"182.5","days_to_expiry":"8","exercise_edge":"the time value was larger"},{"ex_date_iso":"2024-08-12","ex_pretty":"August 12, 2024","dividend_usd":0.25,"time_value_usd":2.29,"strike":"215","days_to_expiry":"7","exercise_edge":"the time value was larger"},{"ex_date_iso":"2024-11-08","ex_pretty":"November 8, 2024","dividend_usd":0.25,"time_value_usd":1.77,"strike":"225","days_to_expiry":"8","exercise_edge":"the time value was larger"},{"ex_date_iso":"2025-02-10","ex_pretty":"February 10, 2025","dividend_usd":0.25,"time_value_usd":2.43,"strike":"225","days_to_expiry":"7","exercise_edge":"the time value was larger"},{"ex_date_iso":"2025-05-12","ex_pretty":"May 12, 2025","dividend_usd":0.26,"time_value_usd":3.22,"strike":"197.5","days_to_expiry":"7","exercise_edge":"the time value was larger"},{"ex_date_iso":"2025-08-11","ex_pretty":"August 11, 2025","dividend_usd":0.26,"time_value_usd":2.12,"strike":"227.5","days_to_expiry":"7","exercise_edge":"the time value was larger"},{"ex_date_iso":"2025-11-10","ex_pretty":"November 10, 2025","dividend_usd":0.26,"time_value_usd":2.72,"strike":"267.5","days_to_expiry":"7","exercise_edge":"the time value was larger"},{"ex_date_iso":"2026-02-09","ex_pretty":"February 9, 2026","dividend_usd":0.26,"time_value_usd":2.87,"strike":"275","days_to_expiry":"5","exercise_edge":"the time value was larger"},{"ex_date_iso":"2026-05-11","ex_pretty":"May 11, 2026","dividend_usd":0.27,"time_value_usd":1.87,"strike":"292.5","days_to_expiry":"5","exercise_edge":"the time value was larger"},{"ex_date_iso":"2026-08-10","ex_pretty":"August 10, 2026","dividend_usd":0.27,"time_value_usd":2.85,"strike":"312.5","days_to_expiry":"5","exercise_edge":"the time value was larger"}],"shape":"table","sql":"WITH ex_dates AS\n(\n    SELECT\n        toDate(ex_dividend_date) AS ex_date,\n        max(toFloat64(cash_amount)) AS dividend\n    FROM global_markets.stocks_dividends\n    WHERE ticker = 'AAPL'\n      AND toDate(ex_dividend_date) >= toDate('2021-09-01')\n      AND toDate(ex_dividend_date) < today()\n    GROUP BY ex_date\n),\noption_sessions AS\n(\n    SELECT DISTINCT toDate(date) AS session_date\n    FROM global_markets.options_greeks\n    WHERE underlying_symbol = 'AAPL'\n      AND date >= '2021-08-01'\n),\ncutoffs AS\n(\n    SELECT\n        e.ex_date AS ex_date,\n        e.dividend AS dividend,\n        max(o.session_date) AS last_session_before\n    FROM ex_dates AS e\n    CROSS JOIN option_sessions AS o\n    WHERE o.session_date < e.ex_date\n    GROUP BY e.ex_date, e.dividend\n),\npicked AS\n(\n    SELECT\n        ex_date,\n        dividend,\n        argMin(time_value, gap) AS time_value,\n        argMin(strike_usd, gap) AS strike_usd,\n        argMin(dte, gap) AS dte\n    FROM\n    (\n        SELECT\n            c.ex_date AS ex_date,\n            c.dividend AS dividend,\n            (toInt32(g.days_to_expiry),\n             toFloat64(g.underlying_close) - toFloat64(g.strike_price)) AS gap,\n            toFloat64(g.option_close)\n              - (toFloat64(g.underlying_close) - toFloat64(g.strike_price)) AS time_value,\n            toFloat64(g.strike_price) AS strike_usd,\n            toInt32(g.days_to_expiry) AS dte\n        FROM global_markets.options_greeks AS g\n        INNER JOIN cutoffs AS c ON toDate(g.date) = c.last_session_before\n        WHERE g.underlying_symbol = 'AAPL'\n          AND lower(toString(g.option_type)) IN ('call', 'c')\n          AND toFloat64(g.option_close) > 0\n          AND toDate(g.expiration_date) > c.ex_date\n          AND toInt32(g.days_to_expiry) <= 45\n          AND toFloat64(g.strike_price) < toFloat64(g.underlying_close)\n          AND toFloat64(g.strike_price) > toFloat64(g.underlying_close) * 0.97\n    )\n    GROUP BY ex_date, dividend\n)\nSELECT\n    toString(ex_date) AS ex_date_iso,\n    concat(monthName(ex_date), ' ', toString(toDayOfMonth(ex_date)), ', ', toString(toYear(ex_date))) AS ex_pretty,\n    round(dividend, 2) AS dividend_usd,\n    round(time_value, 2) AS time_value_usd,\n    toString(round(strike_usd, 1)) AS strike,\n    toString(dte) AS days_to_expiry,\n    if(time_value < dividend, 'the dividend was larger', 'the time value was larger') AS exercise_edge\nFROM picked\nORDER BY ex_date","computed_at":"2026-10-05T15:27:37.800596+00:00","elapsed":6.700037208}