# DCA Screener — 阶梯式买入筛选器

When user asks about 阶梯式买入 / DCA / 分批建仓 / drip-feeding into dividend stocks.

## Scoring Model (6 Dimensions, 100 points total)

| Dimension | Weight | Logic |
|-----------|--------|-------|
| Dividend Yield | /25 | ≥15%→25, ≥10%→22, ≥7%→18, ≥5%→15, ≥3%→10, <3%→3 |
| PE (sweet spot 5-12) | /20 | <5→15, <8→20(best), <12→18, <15→14, <20→10, ≥20→5, negative→3 |
| PB (below 1 is great) | /15 | <0.5→15, <0.8→13, <1.0→11, <1.5→8, <2.0→5, ≥2→3 |
| Price Position (60d) | /15 | <20%→15(best), <35%→12, <50%→10, <65%→7, <80%→4, ≥80→2 |
| YTD Drawdown | /15 | <-15%→15, <-10→13, <-5→11, <0→9, <10→6, ≥10→3 |
| Safety | /10 | profitable(+3), PB<1.5(+3), yield 3-15%(+4) |

Grades: 🔥 ≥70 (strong buy) | ⭐ ≥55 (recommended) | ✅ <55 (moderate)

## Price Ladder Calculation

```
tier1 = current_price           # Current level, buy 40%
tier2 = 20day_support           # Recent support, buy 30%
tier3 = 60day_low × 0.98       # Below period low, buy 30%
```

## Candidate Universe

### US — BDCs (Business Development Companies)
ARCC, HTGC, MAIN, GAIN, GLAD, PSEC, FSK, HRZN, TSLX

### US — mREITs (Mortgage REITs)
NLY, AGNC, ARR, DX, NYMT, CIM, ORC

### US — Equity REITs
O, VICI, WPC, SPG

### US — Blue Chip Dividend
MO, VZ, T, XOM, CVX, BTI, PG, JNJ, KO, PEP, ABBV

### US — MLP/Energy
ET, EPD, MPLX, USAC

### US — Covered Call ETFs
JEPI, JEPQ, QYLD, SPYI, DIVO, SVOL

### US — Utilities
NEE, DUK, SO, D

### HK — High Dividend Blue Chips
1088.HK (神华), 0883.HK (中海油), 3968.HK (招行), 2318.HK (平安),
0939.HK (建行), 1398.HK (工行), 3988.HK (中行), 0005.HK (汇丰),
0003.HK (中煤气), 0011.HK (恒生), 0002.HK (中电), 0006.HK (电能),
0016.HK (新地), 0012.HK (恒基), 0388.HK (港交所), 1299.HK (友邦),
0267.HK (中信), 0066.HK (港铁), 0857.HK (中石油), 0728.HK (中国电信)

### HK — High-Yield ETFs
3416.HK (AGX国指兑), 3417.HK (AGX恒科备兑)

## Pitfalls

- **mREIT rate sensitivity**: NLY/AGNC/DX are heavily influenced by Fed rate policy. In rate-cutting cycles, they outperform; in tightening cycles, dividends may be cut.
- **BDC credit risk**: BDCs lend to mid-market companies. During recessions, default rates rise and NAV can decline.
- **HK bank property exposure**: HK bank stocks (招行/工行/中行) have real estate exposure. Valuations may already reflect property market stress.
- **PE negative = red flag**: Stocks with negative PE (some BDCs like FSK, PSEC) may have unsustainable dividends despite high headline yields.
- **YTD hot stocks penalized**: Stocks with YTD > +20% (like 0883.HK +25%, 0857.HK +26%) score lower on DCA because they're less attractive for new money entry.
- **Price=0 on weekends**: LongPort returns 0 for last_done when markets are closed. Use calc_indexes data (PE/PB/yield) which are always available.
- **LongPort Quote object**: `SecurityQuote` does NOT have `change_rate` attribute on some market data tiers. Use `calc_indexes` with `CalcIndex.ChangeRate` instead.

## Script Template

Save as `/tmp/dca_screen.py` (never use `python3 -c` with HK stock codes starting with digits).

Key script pattern:
```python
# 1. Load env from bashrc (LONGBRIDGE_* → LONGPORT_*)
# 2. ctx.calc_indexes(candidates, [DividendRatioTtm, PeTtmRatio, PbRatio, TotalMarketValue, ...])
# 3. ctx.candlesticks(sym, Period.Day, 60, AdjustType.ForwardAdjust) for price ladder
# 4. ctx.static_info(syms) for names
# 5. Score + sort + present
```

Batch sizes: quotes 20/batch, calc_indexes 10/batch, static_info 20/batch.
