# HL-Bot V2 — Morgen Status

## Service läuft JETZT (seit 16:53)
```bash
sudo systemctl status hl-bot-v2
sudo journalctl -u hl-bot-v2 -f
```

## Was heute gebaut + gefixt wurde

### Architektur (~/hl-bot-v2)
- **Orderflow-Engine**: L2 Book, Tape, CVD-Tracking, Absorption, Volume Profile, Stacked Imbalances
- **LLM-Brain** (DeepSeek): voller Orderflow-Kontext + Signal Alignment Matrix 7/7
- **Risk-Engine**: 6 Layer mit ATR 0.8x Floor + Coin-spezifische Parameter aus V1

### 3 Fixes die Win Rate verbessern
1. ✅ **Per-Coin Exposure Limit** — max 1 Trade pro Coin gleichzeitig (HYPE-Spam fixiert)
2. ✅ **Break-Even Manager** — wenn MFE > 0.5%, Stop automatisch auf Entry
3. ✅ **Position Tracking** — Stop/Target/BE Check jede 90s, echte PnL-Berechnung

### Rate Limit Fixes
- 3 req/s (burst 8), scan 90s interval, 1 book sample
- Keine 429 mehr seit dem Fix

## Aktuelle Paper-Positionen (17:10)
```
BTC  SHORT @ 76777.5  SL=77100 TP=76000  R:R=2.4  MFE=-0.12% (läuft)
HYPE SHORT @ 59.3395  SL=60.18 TP=57.50  R:R=2.2  MFE=-0.20% (läuft)
```

## Journal checken
```bash
cd ~/hl-bot-v2
sudo journalctl -u hl-bot-v2 -f                    # live tail
.venv/bin/python -m hlbot report --hours 12        # summary

# OHLC Validierung aller Trades
python3 << 'EOF'
import json, time, requests
from pathlib import Path

journal = Path('data/journal.jsonl')
trades = [json.loads(l) for l in journal.read_text().strip().split('\n') if l]
submits = [t for t in trades if t.get('event') == 'submit']
closes = [t for t in trades if t.get('event') == 'close']
be_moves = [t for t in trades if t.get('event') == 'stop_to_break_even']

longs = [t for t in submits if t.get('side') == 'long']
shorts = [t for t in submits if t.get('side') == 'short']
wins = [t for t in closes if t.get('pnl_usd', 0) > 0]
losses = [t for t in closes if t.get('pnl_usd', 0) < 0]
total_pnl = sum(t.get('pnl_usd', 0) for t in closes)

print(f"Submits: {len(submits)} ({len(longs)}L / {len(shorts)}S)")
print(f"Closes: {len(closes)} ({len(wins)}W / {len(losses)}L)")
print(f"BE Moves: {len(be_moves)}")
print(f"Total PnL: ${total_pnl:+.2f}")
print(f"Win Rate: {len(wins)/max(1,len(closes))*100:.0f}%")
EOF
```

## Stop/Start
```bash
sudo systemctl stop hl-bot-v2
sudo systemctl start hl-bot-v2
sudo systemctl restart hl-bot-v2
```

## Morgen Entscheidungen
- Win Rate > 40%? → Execution-Modul bauen (echte Orders via Hyperliquid SDK)
- Win Rate < 40%? → LLM Prompt schärfen (ATR-Stop-Regeln aus Wiki)
- Viele BE Events? → Trailing Stop hinzufügen (BE + 0.3% trailing)

## Files
```
~/hl-bot-v2/
├── hlbot/              # Python modules (api, orderflow, brain, risk, cli)
├── config.toml         # interval=90s, samples=1, max_coins=8, max_open=2
├── data/journal.jsonl  # trade log (sammelt über Nacht)
└── MORGEN.md           # diese datei

~/hyperliquid-bb-bot    # V1 bleibt unberührt (läuft auch noch!)
```
