This guide walks you through setting up AlphaRatio Scanner for local development or private deployment.
- OS: Linux, macOS, or Windows (WSL2 recommended for Windows users).
- Python: Version 3.12 or 3.13. (Note: Numba and some TA libraries may lag behind bleeding-edge Python releases).
- RAM: 1GB Minimum (4GB recommended if scanning >1000 symbols).
We highly recommend using uv by Astral for managing the Python environment, as it is significantly faster than standard pip.
Linux/macOS:
curl -LsSf https://astral.sh/uv/install.sh | shWindows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"git clone https://github.com/coderkrp/ratio-scanner.git
cd ratio-scanner
# Create a virtual environment specifically for Python 3.12
uv venv --python 3.12
# Activate it (Linux/macOS)
source .venv/bin/activate
# Activate it (Windows)
# .venv\Scripts\activate
# Install dependencies from pyproject.toml / requirements.txt
uv pip install -r requirements.txtAlphaRatio uses Telegram as its primary UI for delivering alerts.
- Open Telegram and search for
@BotFather. - Send the command
/newbotand follow the prompts to name your bot. - BotFather will provide an HTTP API Token (e.g.,
123456789:ABCdefGHIjklMNOpqrSTUvwxYZ). Keep this secret. - Next, find out your personal Chat ID by searching for
@userinfobotand sending it a message. It will reply with yourId. - If you want the bot to post to a group/channel, add the bot to the group, and use a tool like
@RawDataBotin the group to get the group's Chat ID (usually starts with a-).
Copy the template configuration file:
cp config.example.yaml config.yamlEdit config.yaml to include your Telegram credentials and desired watchlists. See Configuration Guide for details.
Before running the daily scanner, you must create the SQLite database schema and perform the initial historical data fetch. This process downloads maximum available history for your configured symbols to establish a baseline for All-Time Highs and long-term moving averages.
# Ensure the root directory is in the Python Path
export PYTHONPATH=.
# Run the seeder
uv run scripts/seed_database.pyNote: If you have hundreds of symbols, this may take a few minutes. yfinance rate limits are handled automatically.
To execute a manual run of the entire pipeline:
uv run main.pyCheck your Telegram app—you should receive a Daily Digest!