Skip to content
View vincegremillion's full-sized avatar

Block or report vincegremillion

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
vincegremillion/README.md

Stock News Scheduler & Alpaca Paper Trading System

Nightly analysis of a retail swing-trader's watchlist with automated paper-trade execution via Alpaca Markets.

What it does

Every day at 8:30 PM Central Time, the system:

  1. Pulls closing prices for every symbol on your watchlist.
  2. Fetches recent news from Yahoo Finance.
  3. Computes support & resistance levels using pivot-point clustering.
  4. Runs multi-timeframe trend analysis (10/20/50-day MAs, ADX, RSI, ATR).
  5. Generates a plain-English recommendation for each stock:
    • Whether to scalp, swing (1-3 days), or hold a continuation trade (multi-day/week).
    • Key levels to watch and estimated days for a $10 move.
  6. Optionally submits bracket orders (market entry + take-profit + stop-loss) to your Alpaca paper-trading account.
  7. Manages existing positions: closes trades whose trend alignment has broken.

Watchlist

AAPL  NVDA  MU   UNH   TSLA  MSTR  AMD  MSFT
AMZN  TSM   BIDU PLTR  XLB   SLV   SIL  PAAS
AG    CDE   SVM

Setup

# 1. Clone the repo
git clone <repo-url> && cd <repo>

# 2. Create a virtual environment
python3 -m venv .venv && source .venv/bin/activate

# 3. Install dependencies
pip install -r requirements.txt

# 4. Configure API keys
cp .env.example .env
# Edit .env and add your Alpaca paper-trading keys
# Get them at https://app.alpaca.markets/paper/dashboard/overview

Usage

# Run the report once (no scheduling, no orders)
python main.py --once

# Run the report once AND submit paper trades to Alpaca
python main.py --once --trade

# Start the 8:30 PM CT daily scheduler (report only)
python main.py

# Start the scheduler with auto paper-trading enabled
python main.py --trade

# Override the default watchlist
python main.py --once --symbols "AAPL,TSLA,NVDA"

# Check Alpaca account status
python main.py --account

# List open positions
python main.py --positions

# Cancel all open orders
python main.py --cancel-orders

Report Output

Each symbol in the nightly report includes:

Field Description
Close Most recent closing price
News Up to 8 recent headlines with links
Support Up to 4 clustered support levels below current price
Resistance Up to 4 clustered resistance levels above current price
Trend (10/20/50d) Bullish / Bearish / Neutral per timeframe
ADX Trend strength (>25 = trending, >30 = strong)
RSI Overbought (>70) / Oversold (<30)
ATR Average daily dollar range
Recommendation Scalp vs. swing vs. continuation advice
$10 Move Estimate Days needed at current ATR

Trading Strategy

Entry Rules

  • Trend continuation: All timeframes aligned + ADX >= 25 → bracket order in trend direction.
    • ADX >= 30: TP = 2.5x ATR, SL = 1x ATR (multi-day hold)
    • ADX 25-30: TP = 1.5x ATR, SL = 1x ATR (swing)
  • Mean-reversion: RSI <= 30 near support → buy; RSI >= 70 near resistance → sell.

Position Management

  • Nightly review: close positions whose trend alignment breaks or ADX < 20.
  • Position sizing: 5% of equity per trade, capped at 1% risk per ATR.
  • Maximum 10 concurrent positions.

Project Structure

├── main.py                  # CLI entry point
├── src/
│   ├── config.py            # All configuration and constants
│   ├── data_fetcher.py      # Price history and news from Yahoo Finance
│   ├── technical_analysis.py# S/R levels, trend metrics, recommendations
│   ├── strategy.py          # Trade idea generation and position management
│   ├── alpaca_trader.py     # Alpaca paper-trading API wrapper
│   ├── scheduler.py         # 8:30 PM CT scheduler loop
│   └── report_generator.py  # Nightly report text builder
├── tests/                   # Test suite
├── reports/                 # Saved nightly reports (gitignored)
├── requirements.txt
├── .env.example
└── .gitignore

Popular repositories Loading

  1. HashTag HashTag Public

    Forked from Cyber-Forensic/HashTag

    Password Hash Identification

    Python

  2. vincegremillion vincegremillion Public

    Config files for my GitHub profile.

    Python

  3. CIPP CIPP Public

    Forked from KelvinTegelaar/CIPP

    CIPP is a M365 multitenant management solution

    JavaScript

  4. CIPP-API CIPP-API Public

    Forked from KelvinTegelaar/CIPP-API

    PowerShell

  5. evilginx2 evilginx2 Public

    Forked from kgretzky/evilginx2

    Standalone man-in-the-middle attack framework used for phishing login credentials along with session cookies, allowing for the bypass of 2-factor authentication

    Go

  6. cqvulnsite cqvulnsite Public

    Batchfile