Python Stock Screener: Calculate Close to 52-Week High Ratio (EOD API & Pandas) | Part 9 ๐Ÿ”Ž

Matt Macarty ยท Beginner ยท๐Ÿ› ๏ธ AI Tools & Apps ยท4y ago

About this lesson

@MattMacarty ## ๐Ÿ Python Stock Screener: Calculate Close to 52-Week High Ratio (EOD API & Pandas) | Part 9 Welcome to Part 9 of the **Python Stock Analysis Course**! This video concludes the "macro analysis" section of the course by walking you through the creation of a simple, yet powerful, **stock screener**. This tool allows you to quickly filter a large list of stocks based on a quantitative metric. You will learn how to integrate data from two different API feedsโ€”**current closing prices** and **52-Week High technical data**โ€”into a single **Pandas DataFrame** and calculate the screening ratio (`Close Price / 52-Week High`). This ratio helps identify stocks that are trading far below their annual high. ### ๐ŸŽฏ Key Learning Outcomes: 1. **Fundamental Data API:** Understand the structure and complexity of calling fundamental/technical data from the **EOD Historical Data API**. 2. **Bulk vs. Symbol Calls:** Implement logic to retrieve current close prices in **bulk** and then loop through the list to get the **52-Week High** data on a **symbol-by-symbol** basis. 3. **Data Merging:** Combine the two disparate datasets (prices and 52-week highs) into a single, clean Pandas DataFrame using a **merge** operation. 4. **Screener Logic:** Calculate the final **Close to 52-Week High Ratio** column to rank securities for further investigation. ### โฑ๏ธ Video Chapters (Jump Ahead!): 0:00 - Introduction & Section 1 Wrap-up (Moving to Stock Screener) 0:46 - **Reviewing the EOD Fundamental Data API Structure** (Nested Data) 2:10 - Setting up the API Call to **Bulk Download Recent Closing Prices** 3:00 - Filtering the Bulk Data to a Selected List of Tickers 3:50 - Looping Through Symbols to Fetch **52-Week High** Technicals 5:15 - Building a **Mask** to Filter Close Prices 5:50 - Converting Dictionary Data to a **Pandas Series** 6:05 - **Merging** Prices and 52-Week High DataFrames 6:25 - Calculating the **Close / 52-Week High Screener Ratio** 6:45 - Testing the Function

Original Description

@MattMacarty ## ๐Ÿ Python Stock Screener: Calculate Close to 52-Week High Ratio (EOD API & Pandas) | Part 9 Welcome to Part 9 of the **Python Stock Analysis Course**! This video concludes the "macro analysis" section of the course by walking you through the creation of a simple, yet powerful, **stock screener**. This tool allows you to quickly filter a large list of stocks based on a quantitative metric. You will learn how to integrate data from two different API feedsโ€”**current closing prices** and **52-Week High technical data**โ€”into a single **Pandas DataFrame** and calculate the screening ratio (`Close Price / 52-Week High`). This ratio helps identify stocks that are trading far below their annual high. ### ๐ŸŽฏ Key Learning Outcomes: 1. **Fundamental Data API:** Understand the structure and complexity of calling fundamental/technical data from the **EOD Historical Data API**. 2. **Bulk vs. Symbol Calls:** Implement logic to retrieve current close prices in **bulk** and then loop through the list to get the **52-Week High** data on a **symbol-by-symbol** basis. 3. **Data Merging:** Combine the two disparate datasets (prices and 52-week highs) into a single, clean Pandas DataFrame using a **merge** operation. 4. **Screener Logic:** Calculate the final **Close to 52-Week High Ratio** column to rank securities for further investigation. ### โฑ๏ธ Video Chapters (Jump Ahead!): 0:00 - Introduction & Section 1 Wrap-up (Moving to Stock Screener) 0:46 - **Reviewing the EOD Fundamental Data API Structure** (Nested Data) 2:10 - Setting up the API Call to **Bulk Download Recent Closing Prices** 3:00 - Filtering the Bulk Data to a Selected List of Tickers 3:50 - Looping Through Symbols to Fetch **52-Week High** Technicals 5:15 - Building a **Mask** to Filter Close Prices 5:50 - Converting Dictionary Data to a **Pandas Series** 6:05 - **Merging** Prices and 52-Week High DataFrames 6:25 - Calculating the **Close / 52-Week High Screener Ratio** 6:45 - Testing the Function
Watch on YouTube โ†— (saves to browser)
Sign in to unlock AI tutor explanation ยท โšก30

Related Reads

๐Ÿ“ฐ
The Best AI Course Generator in 2026? I Tested 7 to Find Out.
Discover the best AI course generator through a comparison of 7 platforms, and learn how to choose the right one for your needs
Dev.to AI
๐Ÿ“ฐ
Automate Spotify and YouTube Playlists - Chapter 2: Setting Up Spotify
Automate Spotify playlists by setting up a Spotify account and preparing for API integration, crucial for music lovers and developers alike
Dev.to ยท Tawanda Nyahuye
๐Ÿ“ฐ
Use a model route manifest before Dify, Cursor, and Node.js share Vector Engine
Learn to reduce inconsistencies in shared API gateways by using a model route manifest with Node.js, Dify, and Cursor
Dev.to AI
๐Ÿ“ฐ
What 90 Days of Comments on AI Side Panels Taught Me About Distribution
Analyzing 90 days of comments on AI side panels reveals key insights on distribution and user engagement
Dev.to ยท AI Buddy

Chapters (10)

Introduction & Section 1 Wrap-up (Moving to Stock Screener)
0:46 **Reviewing the EOD Fundamental Data API Structure** (Nested Data)
2:10 Setting up the API Call to **Bulk Download Recent Closing Prices**
3:00 Filtering the Bulk Data to a Selected List of Tickers
3:50 Looping Through Symbols to Fetch **52-Week High** Technicals
5:15 Building a **Mask** to Filter Close Prices
5:50 Converting Dictionary Data to a **Pandas Series**
6:05 **Merging** Prices and 52-Week High DataFrames
6:25 Calculating the **Close / 52-Week High Screener Ratio**
6:45 Testing the Function
Up next
ElevenLabs Review and Tutorial: Free AI Content Tools
LoverFighterWriter
Watch โ†’