{"slug":"covid-stimulus-rally-2020","qid":"recovery","label":"Did it hold? The retest that never came, and two recovery clocks","post_title":"March 24, 2020: The Day the Market Turned","post_url":"/blog/covid-stimulus-rally-2020#q-recovery","columns":["feb19_ath_close","mar23_bottom_close","recovery_date","sessions_to_new_high","days_low_to_new_high","round_trip_days","lowest_close_after","lowest_close_date","closest_retest_pct","peak_2007_date","recovery_2013_date","round_trip_2008_days"],"rows":[{"feb19_ath_close":338.31,"mar23_bottom_close":222.51,"recovery_date":"2020-08-18","sessions_to_new_high":103,"days_low_to_new_high":148,"round_trip_days":181,"lowest_close_after":243.59,"lowest_close_date":"2020-03-24","closest_retest_pct":9.5,"peak_2007_date":"2007-10-09","recovery_2013_date":"2013-03-14","round_trip_2008_days":1983}],"shape":"scalar","sql":"SELECT\n    round(ath_close, 2) AS feb19_ath_close,\n    round(bottom_close, 2) AS mar23_bottom_close,\n    toString(rec_date) AS recovery_date,\n    countIf(et_date > toDate('2020-03-23') AND et_date <= rec_date) AS sessions_to_new_high,\n    dateDiff('day', toDate('2020-03-23'), rec_date) AS days_low_to_new_high,\n    dateDiff('day', toDate('2020-02-19'), rec_date) AS round_trip_days,\n    round(minIf(close_usd, et_date > toDate('2020-03-23') AND et_date <= rec_date), 2) AS lowest_close_after,\n    toString(argMinIf(et_date, (close_usd, et_date), et_date > toDate('2020-03-23') AND et_date <= rec_date)) AS lowest_close_date,\n    round((minIf(close_usd, et_date > toDate('2020-03-23') AND et_date <= rec_date) / bottom_close - 1) * 100, 1) AS closest_retest_pct,\n    toString(peak07_date) AS peak_2007_date,\n    toString(rec07_date) AS recovery_2013_date,\n    dateDiff('day', peak07_date, rec07_date) AS round_trip_2008_days\nFROM (\n    SELECT\n        et_date, close_usd, ath_close, bottom_close, peak07_date,\n        min(if(et_date > toDate('2020-03-23') AND close_usd >= ath_close, et_date, toDate('2099-01-01'))) OVER () AS rec_date,\n        min(if(et_date >= toDate('2008-01-01') AND close_usd >= peak07_close, et_date, toDate('2099-01-01'))) OVER () AS rec07_date\n    FROM (\n        SELECT\n            et_date, close_usd,\n            max(if(et_date = toDate('2020-02-19'), close_usd, -999)) OVER () AS ath_close,\n            max(if(et_date = toDate('2020-03-23'), close_usd, -999)) OVER () AS bottom_close,\n            max(if(et_date >= toDate('2007-01-01') AND et_date < toDate('2008-01-01'), (close_usd, et_date), (-999., toDate('1970-01-01')))) OVER () .1 AS peak07_close,\n            max(if(et_date >= toDate('2007-01-01') AND et_date < toDate('2008-01-01'), (close_usd, et_date), (-999., toDate('1970-01-01')))) OVER () .2 AS peak07_date\n        FROM (\n            SELECT\n                toDate(toTimeZone(window_start, 'America/New_York')) AS et_date,\n                argMaxIf(toFloat64(close), window_start, (toHour(toTimeZone(window_start, 'America/New_York')) * 60 + toMinute(toTimeZone(window_start, 'America/New_York'))) BETWEEN 570 AND 959) AS close_usd\n            FROM global_markets.delayed_stocks_minute_aggs\n            WHERE ticker = 'SPY' AND window_start < toDateTime('2021-01-01 00:00:00')\n            GROUP BY et_date\n            HAVING close_usd > 0\n        )\n    )\n)\nGROUP BY ath_close, bottom_close, rec_date, peak07_date, rec07_date","computed_at":"2026-07-26T05:29:18.352702+00:00","elapsed":5.704119884}