8000 GitHub - shankar0123/golden_cross_scanner
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

shankar0123/golden_cross_scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golden Cross Stock Scanner

This application scans stocks listed on the NYSE and NASDAQ (excluding ETFs and non-common stock) to identify instances of "Golden Cross" or "Death Cross" technical patterns.

Technical Patterns Scanned

  • Golden Cross (Bullish): The 50-day Simple Moving Average (SMA) crosses above the 200-day Simple Moving Average (SMA).
  • Death Cross (Bearish): The 50-day Simple Moving Average (SMA) crosses below the 200-day Simple Moving Average (SMA).

This application specifically looks for:

  1. The relevant SMA crossover (50-day vs. 200-day) occurring on the most recent trading day.
  2. The SMAs being in the opposite position on the prior trading day (e.g., for a Golden Cross, 50-day SMA <= 200-day SMA on the previous day).
  3. Optional volume confirmation: If enabled, the volume on the crossover day must be greater than a specified multiple of the 20-day average volume.

Features

  • Fetches a list of publicly traded stocks from the official NASDAQ FTP site (NASDAQ & Other Listed), filtering out ETFs and test issues.
  • Retrieves historical daily price data for each ticker using the yfinance library.
  • Calculates 50-day and 200-day SMAs, and 20-day average volume using pandas.
  • Identifies tickers exhibiting a Golden Cross or Death Cross on the latest trading day.
  • Allows users to select the scan type (Golden Cross, Death Cross, or Both).
  • Provides an adjustable threshold for optional volume confirmation.
  • Displays the results in an interactive table using Streamlit.
  • Shows mini-charts for each identified ticker, visualizing the closing price, SMAs, and the crossover event.

Technologies Used

  • Backend/Analysis: Python 3
  • Web Framework/UI: Streamlit
  • Data Fetching: yfinance, urllib.request (for FTP)
  • Data Manipulation: pandas
  • Charting: matplotlib

Setup

  1. Clone the repository (if applicable):
    git clone <repository-url>
    cd golden_cross_scanner
  2. Create a Python virtual environment:
    python3 -m venv .venv
  3. Activate the virtual environment:
    • macOS/Linux: source .venv/bin/activate
    • Windows: .venv\Scripts\activate
  4. Install dependencies:
    pip install -r requirements.txt

How to Run

  1. Ensure your virtual environment is activated.
  2. Run the Streamlit application:
    streamlit run app.py
  3. The application will open in your default web browser.
  4. Select the desired "Scan Type" (Golden Cross, Death Cross, or Both).
  5. Adjust the "Volume Confirmation Multiplier" if desired (set > 1.0 to enable the filter, e.g., 1.5 means volume must be > 1.5x the 20-day average).
  6. Click the "🚀 Scan for [Selected Type]" button to start the analysis.

Note: The initial scan can take a significant amount of time depending on the total number of stock tickers (~8,000-10,000+) and your network connection speed, as it needs to fetch data for each one. Subsequent runs within 6 hours will use a cached ticker list.

Configuration

You can adjust some parameters directly in the app.py script:

  • DAYS_OF_DATA: Number of historical days fetched per ticker (default: 500).
  • CHART_DAYS: Number of days displayed on the mini-charts (default: 100).
  • AVG_VOL_WINDOW: Lookback period for calculating average volume (default: 20).
  • TICKER_LIMIT: Set to an integer (e.g., 50) to limit the number of tickers scanned during development/testing. Set to None to scan all tickers.

Data Sources

  • Ticker Symbols (Stocks Only): NASDAQ Trader FTP (ftp://ftp.nasdaqtrader.com/symboldirectory/)
  • Historical Stock Data: Yahoo Finance (via yfinance library)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0