stock-monitor

stock-monitor

A full-featured intelligent stock monitoring and alert system. Supports 7 major alert rules including cost percentage, moving average golden cross/death cross, RSI overbought/oversold, volume anomalies, gap openings, and dynamic profit-taking. Matches Chinese investor habits (red for up, green for down).

46stars
7forks
Updated 2/3/2026
SKILL.md
read-only
name
stock-monitor
description

A full-featured intelligent stock monitoring and alert system. Supports 7 major alert rules including cost percentage, moving average golden cross/death cross, RSI overbought/oversold, volume anomalies, gap openings, and dynamic profit-taking. Matches Chinese investor habits (red for up, green for down).

Stock Monitor Pro - Full-Featured Intelligent Investment Advisory System

🎯 Core Features

1. Seven Alert Rules (All Included!)

Rule Trigger Condition Weight
Cost Percentage Profit +15% / Loss -12% ⭐⭐⭐
Intraday Change Individual ±4% / ETF ±2% / Gold ±2.5% ⭐⭐
Volume Anomaly Volume >2x average / Volume <0.5x average ⭐⭐
MA Golden/Death Cross MA5 crosses above/below MA10 ⭐⭐⭐
RSI Overbought/Oversold RSI>70 overbought / RSI<30 oversold ⭐⭐
Gap Opening Upward/downward gap >1% ⭐⭐
Dynamic Profit-Taking After 10% profit, pullback 5%/10% ⭐⭐⭐

2. Tiered Alert System

  • 🚨 Emergency: Multiple conditions coincide (e.g., volume surge + MA golden cross + breakout above cost)
  • ⚠️ Warning: 2 conditions triggered (e.g., RSI oversold + volume surge)
  • πŸ“’ Reminder: Single condition triggered

3. Chinese Habits

  • πŸ”΄ Red = Up / Profit
  • 🟒 Green = Down / Loss

πŸ“‹ Monitoring Configuration

Complete Alert Rule Example

{
    "code": "600362",
    "name": "Jiangxi Copper",
    "type": "individual",  # Individual stock
    "market": "sh",
    "cost": 57.00,          # Holding cost
    "alerts": {
        # 1. Cost percentage
        "cost_pct_above": 15.0,    # Alert at 15% profit (Β₯65.55)
        "cost_pct_below": -12.0,   # Alert at 12% loss (Β₯50.16)
        
        # 2. Intraday change (individual Β±4%)
        "change_pct_above": 4.0,
        "change_pct_below": -4.0,
        
        # 3. Volume anomaly
        "volume_surge": 2.0,       # Volume >2x 5-day average
        
        # 4-7. Technical indicators (enabled by default)
        "ma_monitor": True,        # MA golden/death cross
        "rsi_monitor": True,       # RSI overbought/oversold
        "gap_monitor": True,       # Gap opening
        "trailing_stop": True      # Dynamic profit-taking
    }
}

Differentiated Thresholds by Asset Type

Type Intraday Change Threshold Volume Threshold Applicable Assets
individual (Individual stock) Β±4% 2x Jiangxi Copper, Ping An of China
etf (ETF) Β±2% 1.8x Hang Seng Healthcare, ChiNext 50, etc.
gold (Gold) Β±2.5% None London Gold

πŸš€ How to Run

Background Daemon Process

cd ~/workspace/skills/stock-monitor/scripts
./control.sh start    # Start
./control.sh status   # Check status
./control.sh log      # View logs
./control.sh stop     # Stop

⚑ Smart Frequency (Beijing Time)

Time Period Frequency Monitored Assets
Trading hours 9:30-15:00 Every 5 minutes All + technical indicators
Lunch break 11:30-13:00 Every 10 minutes All
After close 15:00-24:00 Every 30 minutes All (daily data)
Early morning 0:00-9:30 Every 1 hour London Gold only
Weekend Every 1 hour London Gold only

πŸ”” Alert Message Examples

Multiple Conditions Coincide (Emergency)

πŸš¨γ€Emergencyγ€‘πŸ”΄ Jiangxi Copper (600362)
━━━━━━━━━━━━━━━━━━━━
πŸ’° Current Price: Β₯65.50 (+15.0%)
πŸ“Š Holding Cost: Β₯57.00 | P/L: πŸ”΄+14.9%

🎯 Alerts Triggered (3 items):
  β€’ 🎯 Profit 15% (Target price Β₯65.55)
  β€’ 🌟 MA Golden Cross (MA5Β₯63.2 crosses above MA10Β₯62.8)
  β€’ πŸ“Š Volume Surge 2.5x (5-day average)

πŸ“Š Jiangxi Copper In-Depth Analysis
πŸ’° Price Movement:
β€’ Current: 65.5 (+15.0%)
β€’ MA Trend: MA5>MA10>MA20 [Bullish alignment]
β€’ RSI: 68 [Approaching overbought]

πŸ’‘ Kimi's Suggestion:
πŸš€ Multiple conditions coincide, strong trend, consider holding or gradually reducing position.

RSI Oversold (Warning)

βš οΈγ€Warningγ€‘πŸŸ’ Hang Seng Healthcare (159892)
━━━━━━━━━━━━━━━━━━━━
πŸ’° Current Price: Β₯0.72 (-10.0%)
πŸ“Š Holding Cost: Β₯0.80 | P/L: 🟒-10.0%

🎯 Alerts Triggered (2 items):
  β€’ πŸ“‰ Intraday drop -10.0%
  β€’ ❄️ RSI oversold (28.5), possible rebound

πŸ’‘ Kimi's Suggestion:
πŸ” Short-term oversold severely, RSI in oversold zone, watch for rebound opportunities but don't rush to buy the dip.

Dynamic Profit-Taking Reminder

πŸ“’γ€Reminderγ€‘πŸ”΄ Ping An of China (601318)
━━━━━━━━━━━━━━━━━━━━
πŸ’° Current Price: Β₯70.50 (+6.8%)
πŸ“Š Holding Cost: Β₯66.00 | P/L: πŸ”΄+6.8%

🎯 Alert Triggered:
  β€’ πŸ“‰ Profit pullback 5.2%, suggest reducing position to protect profits
  (Max profit 12% has pulled back)

πŸ› οΈ File Structure

stock-monitor/
β”œβ”€β”€ SKILL.md                    # This document
β”œβ”€β”€ RULE_REVIEW_REPORT.md       # Rule review report
└── scripts/
    β”œβ”€β”€ monitor.py              # Core monitoring (7 rules)
    β”œβ”€β”€ monitor_daemon.py       # Background daemon process
    β”œβ”€β”€ analyser.py             # Intelligent analysis engine
    └── control.sh              # One-click control script

βš™οΈ Custom Configuration

Modify Cost Price

"cost": 55.50,  # Change to your actual cost

Adjust Alert Thresholds

"cost_pct_above": 20.0,     # Alert at 20% profit
"cost_pct_below": -15.0,    # Alert at 15% loss
"change_pct_above": 5.0,    # Intraday change Β±5%
"volume_surge": 3.0,        # Alert at 3x volume

Toggle Technical Indicators

"ma_monitor": False,     # Disable MA
"rsi_monitor": True,     # Enable RSI
"gap_monitor": True,     # Enable gap

πŸ“ Changelog

  • v3.0 Full-featured version: Completed 7 alert rules (cost/change/volume/MA/RSI/gap/dynamic profit-taking)
  • v2.4 Cost percentage version: Support percentage alerts based on holding cost
  • v2.3 China version: Red up, green down color convention
  • v2.2 Daemon version: Background daemon process support
  • v2.1 Smart frequency version: Smart frequency control
  • v2.0 Pro version: News sentiment analysis

⚠️ Usage Tips

  1. Technical indicators lag: MA, MACD, etc. are lagging indicators, used to confirm trends rather than predict
  2. Avoid overtrading: Alerts are for reference, don't act on every signal
  3. Multiple conditions are more reliable: Single indicators can produce false signals; multiple conditions are more accurate
  4. Dynamic profit-taking should be flexible: 5% pullback to reduce position, 10% to clear is a suggestion; adjust flexibly based on market conditions

Core Principle:

The goal of the alert system is to "not miss big opportunities, not make big mistakes," not to "catch every fluctuation."