Files
IBKRTrader/README.md
T
Richard cbbedb2e0e @
Doku: Projekt-README (Architektur, Build/Test, Konfiguration, DB-Setup, Status)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@
2026-07-30 10:32:07 +02:00

54 lines
2.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# IBKRTrader
Modulares C#-Trading-Framework für Interactive-Brokers-Aktien. **Harter Core + unabhängige
Strategie-Module + Launcher**, der die Fenster der Module öffnet. Konzept nach dem Vorbild von
PolytraderSharp (nur IBKR statt Polymarket).
## Architektur (Kurzform)
```
IBKRTrader.App WinExe Generic Host + Launcher/Shell (WinForms)
src/IBKRTrader.Core Contracts, EF-Persistenz, Trading-Kern, Worker, Security
src/IBKRTrader.Modules.* je Modul ein eigenes Projekt (referenziert nur Core)
tests/IBKRTrader.Tests xUnit (Unit + EF-InMemory)
```
- **Generic Host** (`Host.CreateDefaultBuilder`), Worker/Services als `IHostedService`.
- **Module** über `IModule` (RegisterServices/RegisterUi/Start/Stop); UI über `IModuleUiHost`/`ModuleView`.
- **Persistenz**: EF Core (Pomelo/MariaDB), Migrationen **extern** angewendet (nicht zur Laufzeit).
- **Trading-Kern**: `IExecutionService` (Signal→Risiko→Order→Buchung), `IRiskService`, `IPortfolioService`,
Broker hinter `IBrokerClient` (Default: `NullBrokerClient` handelt nie, bis IBKR angebunden).
- Details: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
## Build & Test
```bash
dotnet build IBKRTrader.slnx
dotnet test IBKRTrader.slnx
dotnet run --project IBKRTrader.App.csproj -- --smoke-ui # Headless-UI-Check
dotnet run --project IBKRTrader.App.csproj # App starten
```
## Konfiguration
- `appsettings.Local.json` (gitignored) hält den DB-Connection-String (`Database:MySqlConnectionString`).
- `settings.json` (gitignored) App-Settings (IBKR-Ports, Logging, Worker, Trading).
- Optional `IBKRTRADER_MASTER_KEY` bzw. `master.key` für at-rest-Verschlüsselung (AES-256-GCM).
## Datenbank aufsetzen
Schema wird per EF-Migrationen extern angewendet siehe [scripts/README.md](scripts/README.md):
```bash
mysql ... < scripts/drop-app-tables.sql # nur falls Alt-Tabellen existieren
powershell -File scripts/provision-db.ps1
```
## Module
- **CongressTrading** kopiert US-Kongress-Trades (capitoltrades.com) → `TradeSignal` → ExecutionService.
## Status / Nächstes
- Kurskorrektur auf das PolytraderSharp-Konzept (R1R7) abgeschlossen.
- **Nächster Meilenstein:** IBKR-Broker über die **TWS API / IB Gateway** (blockiert bis Paper-Zugang)
Plan: [docs/IBKR-Integration.md](docs/IBKR-Integration.md).
- **Sicherheit:** DB-Passwort rotieren (liegt in der Git-Historie, Commit `ebeb035`).
## Sicherheitshinweis
Automatisierter Handel ist riskant. Standardmäßig handelt die App **nicht** (`NullBrokerClient` +
globales `TradingEnabled=false`). Echter Handel erst nach bewusster Freigabe und Verifikation gegen
den Paper-Account.