Files
mike 657dc41c46 Initial commit: Trading skills collection
- OKX交易自动化 (okx-auto-position, okx-crypto, okx-exchange)
- 交易信号处理 (signal-confirmation-templates, trading-signal-aggregator)
- 量化因子挖掘 (quant-factor-mining)
- 长桥集成 (longbridge-cli, longbridge-python-sdk)
- 六合彩分析 (lottery-hk)
- 股息投资 (dividend-investing, dividend-scanner)
- 日内交易 (intraday-trading)
- 同花顺 (tonghuashun)
2026-07-05 02:39:41 -04:00

42 lines
2.0 KiB
Markdown

# DCA Scanner & Monitoring Architecture
## Overview
Pattern for automated high-dividend stock scanning across multiple markets (HK/US/CN), with DCA ladder buy-signal monitoring.
## Architecture
### Two script types:
1. **Scanner** (`dca_scanner.py`) — Scans a candidate pool for high-yield stocks, pushes TOP5 with ladder prices
2. **Monitor** (`dca_monitor.py`) — Watches existing positions for buy-signal triggers against ladder levels
### Market separation:
- Each script accepts `--market=hk|us|cn` to filter positions/candidates
- Cron jobs are split per market to avoid API collisions and match trading hours
- Scanner candidate pools are hardcoded per market (24 HK / 15 US / 14 CN)
### Cron schedule pattern (EDT, staggered ≥15min):
```
A股扫描: 19:30 (= 北京 7:30AM, A股开盘前)
港股扫描: 20:00 (= 北京 8:00AM, 港股开盘前)
美股扫描: 21:30 (= 北京 9:30AM, 美股开盘前)
美股监控1: 22:30 (美股盘中)
美股监控2: 02:00 (美股盘中)
```
### Rate limiting prevention:
- No two LongPort jobs share the same minute
- Scanner and Monitor never run simultaneously
- RGTI price monitoring (if needed) at 30min intervals, NOT 10/15min
## Key design decisions:
1. **User wants push-based scanning** — "你要扫描高股息的发通知给我,不是我选" — system scans and pushes candidates, user doesn't manually pick from lists
2. **30min polling is enough** for price monitoring — user explicitly said "半小时吧,不需要太频繁"
3. **Merge overlapping tasks** — price alert + auto order were merged into one (RGTI)
4. **Pause mislabeled tasks** — "港股监控" that only had US stocks was paused
5. **Add dividend frequency** to all output — `[季度]` / `[月度]` / `[半年]` suffix
## Data files:
- `~/.hermes/scripts/dca_positions.json` — Current positions with ladder prices, yields, div_freq
- `~/.hermes/scripts/dca_scanner.py` — Market scanner with candidate pools
- `~/.hermes/scripts/dca_monitor.py` — Ladder monitor with market filter support