Building a Multi-Market Breakout Stock Screener in Python
📈 Introduction
In the fast-paced world of stock trading, identifying breakouts—moments when a stock’s price pushes above resistance with strong volume—can lead to powerful opportunities. To automate this process, we developed a multi-market breakout stock screener using Python.
This tool scans across markets like the NYSE, Nikkei 50, and Vietnam 50, analyzing price and volume data to pinpoint potential breakout candidates — and it even generates candlestick charts automatically.
🧠 System Overview
The project consists of three modules that work together seamlessly:
| File | Purpose |
|---|---|
test10.py |
The heart of the system — fetches data and applies breakout screening logic. |
breakout.py |
Provides a clean command-line interface (CLI) for running the screener. |
ui_breakout.py |
A graphical user interface (GUI) built with Tkinter for intuitive use. |
Architecture
flowchart TD
A["ui_breakout.py (GUI Interface)"] --> B["breakout.py (CLI Wrapper)"]
B --> C["test10.py (Core Screener)"]
C --> D["Yahoo Finance API"]
C --> E["Chart Generator (Plotly HTML/PNG)"]
⚙️ How It Works
1. Data Collection
The screener fetches three months of daily stock data from Yahoo Finance for top stocks in each market.
Tickers are automatically loaded (e.g., top 50 by market cap for NYSE, Nikkei, and Vietnam).
2. Screening Logic
The script applies a set of breakout filters:
- Recent High: The close price must exceed the previous
lookbackperiod high. - Volume Surge: The trading volume must exceed the average by a configurable multiple (e.g., 1.5×).
- Liquidity Filter: Ensures sufficient dollar volume to avoid illiquid stocks.
- Weekly Confirmation (optional): Confirms breakouts on weekly timeframes.
Example core logic:
if is_breakout(df_t,
lookback=lookback,
volume_mult=volume_mult,
min_margin=min_margin,
min_close_pct=min_close_pct,
weekly_confirm=weekly_confirm,
weekly_lookback=weekly_lookback):
results.append(t)
The program can retry downloads automatically if rate-limited and runs in batches for efficiency.
🌏 Multi-Market Scanning
You can screen multiple markets simultaneously:
- 🇺🇸 NYSE
- 🇯🇵 Nikkei 50
- 🇻🇳 Vietnam 50
- 🇨🇳 SSE 50
- 🇭🇰 HSI 50
- 🇪🇺 Euronext
- 🇺🇸 S&P 50 / 500
Each market uses a tailored ticker list and outputs separate breakout results and charts.
📊 Chart Generation
After detecting breakout candidates, the system can automatically create candlestick charts using Plotly.
Each chart shows:
- Price and volume data
- Recent highs and breakout zones
- Clear visual confirmation of the breakout setup
Example command:
python breakout.py --markets nyse,nikkei50 --charts --chart-format html
Charts are saved under:
charts/<market>/<ticker>.html
🖥️ Graphical User Interface (GUI)
For users who prefer a visual interface, the Tkinter-based GUI (ui_breakout.py) provides:
✅ Market selection checkboxes
✅ Adjustable filters and thresholds
✅ Real-time log output
✅ Run and cancel buttons
✅ Automatic chart previews

The GUI executes the same backend logic but allows easy exploration without command-line input.
🔧 Example Usage
python breakout.py \
--markets sp500,nyse \
--lookback 20 \
--volume-mult 1.8 \
--charts \
--weekly-confirm
Sample output:
=========> NYSE breakouts: ['AAPL', 'NVDA', 'LMT']
=========> Nikkei50 breakouts: ['SONY', 'TOYOTA']
Saved 12 breakout chart(s) under 'charts/nyse/*.html'
💡 Use Cases
- Swing traders can identify early momentum setups.
- Quant developers can integrate this logic into automated pipelines.
- Analysts and educators can visualize live breakouts in class or reports.
🚀 Future Enhancements
- Add RSI / moving average filters
- Integrate Telegram or Line alerts
- Deploy as a web dashboard with FastAPI
- Include auto-updating market data and backtesting
🧭 Conclusion
This breakout screener demonstrates how Python + yfinance + Plotly can create a professional-grade stock analysis tool.
Whether you prefer CLI or GUI, it helps traders spot breakout opportunities early and visually confirm them before the crowd reacts.
Get in Touch with us
Related Posts
- Temporal × 本地大模型 × Robot Framework 面向中国企业的可靠业务自动化架构实践
- Building Reliable Office Automation with Temporal, Local LLMs, and Robot Framework
- RPA + AI: 为什么没有“智能”的自动化一定失败, 而没有“治理”的智能同样不可落地
- RPA + AI: Why Automation Fails Without Intelligence — and Intelligence Fails Without Control
- Simulating Border Conflict and Proxy War
- 先解决“检索与访问”问题 重塑高校图书馆战略价值的最快路径
- Fix Discovery & Access First: The Fastest Way to Restore the University Library’s Strategic Value
- 我们正在开发一个连接工厂与再生资源企业的废料交易平台
- We’re Building a Better Way for Factories and Recyclers to Trade Scrap
- 如何使用 Python 开发 MES(制造执行系统) —— 面向中国制造企业的实用指南
- How to Develop a Manufacturing Execution System (MES) with Python
- MES、ERP 与 SCADA 的区别与边界 —— 制造业系统角色与连接关系详解
- MES vs ERP vs SCADA: Roles and Boundaries Explained
- 为什么学习软件开发如此“痛苦” ——以及真正有效的解决方法
- Why Learning Software Development Feels So Painful — and How to Fix It
- 企业最终会选择哪种 AI:GPT 风格,还是 Gemini 风格?
- What Enterprises Will Choose: GPT-Style AI or Gemini-Style AI?
- GPT-5.2 在哪些真实业务场景中明显优于 GPT-5.1
- Top Real-World Use Cases Where GPT-5.2 Shines Over GPT-5.1
- ChatGPT 5.2 与 5.1 的区别 —— 用通俗类比来理解













