Summary
Highlights
The challenge is to find the most recent 'golden cross' in five years of historical stock market data. A golden cross occurs when the 50-day moving average crosses from below to above the 200-day moving average. Participants need to calculate both moving averages and a binary flag for the golden cross.
Chris uses Python and Pandas to solve the problem. He imports data, calculates 50-day and 200-day moving averages using the 'rolling' method, and then creates a golden cross flag by comparing current and shifted (previous day) moving averages. He successfully identifies the most recent golden cross on July 1st, 2025.
Aaron tackles the challenge using Power BI's new DAX visual calculations. He creates 50-day and 200-day moving averages and then a 'golden cross' binary flag. He uses variables to store previous day's moving averages and an IF statement to detect the cross. He also identifies the same golden cross on July 1st, 2025.
John uses ChatGPT as a co-pilot to generate the SQL query. He provides the table and column names to ChatGPT, requesting the calculation of 50-day and 200-day moving averages with specific null handling logic, and a binary flag for the golden cross. ChatGPT successfully generates a functional query, although John needed to verify and subtly adjust his input.
Enrique attempts to win with Excel. He sets up a chart for visualization and calculates the 50-day and 200-day moving averages using the 'OFFSET' function, which allows for dynamic range selection. He then creates a simple formula to flag the golden cross based on current and previous day's moving average comparisons, finding the same result.
The results show Python and Power BI performing similarly, with SQL and ChatGPT being a wild card that could have been faster. However, Excel, championed by Enrique, finished the task in an impressive 2 minutes and 38 seconds, officially earning the data drill crown, demonstrating its efficiency for quick ad-hoc analyses.