Hier werden die Konfigurationen vom Docker Host "BrainDock" gesichert und weiterentwickelt.
Go to file Use this template
Marc Blatter 8b40fb5b30 Bot auto-update: src/main_ml.py,src/main_ml.py.backup.18pct,src/main_ml.py.backup.30pct,src/main_ml.py.backup.35pct.20240706,src/main_ml.py.backup.auto-trading,src/main_ml.py.backup_sweep,src/main_ml_BACKUP_before_precision_fix.py,src/main_ml_enhanced.py,src/main_ml_fixed.py,src/main_ml_v02_backup_1783615772.py,src/main_ml_v2.py,src/main_ml_v4_backup.py,src/main_ml_v6.py 2026-07-09 20:35:01 +02:00
docs/analysis Bot V5 ENHANCED: Risk Management Implementation 2026-07-04 22:59:33 +02:00
src Bot auto-update: src/main_ml.py,src/main_ml.py.backup.18pct,src/main_ml.py.backup.30pct,src/main_ml.py.backup.35pct.20240706,src/main_ml.py.backup.auto-trading,src/main_ml.py.backup_sweep,src/main_ml_BACKUP_before_precision_fix.py,src/main_ml_enhanced.py,src/main_ml_fixed.py,src/main_ml_v02_backup_1783615772.py,src/main_ml_v2.py,src/main_ml_v4_backup.py,src/main_ml_v6.py 2026-07-09 20:35:01 +02:00
.documentation-updated-2026-07-09-19-36 Docs: Update Learnings 6&7 + Decisions 5&6 - Crisis resolution (Auto-swap audit + liquidation + V0.3 restart 2026-07-09 19:36) 2026-07-09 19:40:51 +02:00
.gitignore cleanup: Remove backup files, add .gitignore, create production-ready repository structure 2026-07-07 22:16:09 +02:00
ARCHITECTURE.md Docs: Add comprehensive ARCHITECTURE.md - Auto-Swap feature, Risk Management, Components documented 2026-07-08 23:32:49 +02:00
README.md v0.2: Remove V5/V10 labels, consolidate to Version 0.2 with adaptive learning 2026-07-07 22:00:28 +02:00
requirements.txt cleanup: Remove backup files, add .gitignore, create production-ready repository structure 2026-07-07 22:16:09 +02:00

README.md

Trading Bot V0.2 — Adaptive Strategy Learning

Production-ready Crypto Trading Bot with Live P&L Dashboard

Features

Core Trading

  • Adaptive Signal Generation: Win-rate based strategy adjustment (5 levels)
  • Risk Management: Stop Loss (-1.8%), Take Profit (+2.8%), Daily Loss Limit (-5%)
  • Smart Position Sizing: Dynamic investment (50-55%) based on signal confidence
  • Trailing Stop: +1.5% entry, 0.6% trail distance
  • Cooldown Protection: 30min pause after 3 consecutive losses

Adaptive Learning (Option 2)

  • Hourly Strategy Evaluation: Automatically adjusts based on win rate
  • 5 Strategy Levels:
    • 🚨 Emergency (<45% WR): Strict signals, minimal trades
    • ⚠️ Conservative (45-50%): Reduced risk
    • Standard (50-60%): Default settings
    • 🟢 Aggressive (60-70%): Increased signal frequency
    • 🔥 Full Throttle (>70%): Maximum trading

Monitoring & Reporting

  • Live P&L Dashboard: Real-time portfolio value, profit/loss, holdings
  • Performance Reports: 3-hour summaries via Telegram
  • Telegram Alerts: Strategy changes, trade notifications

Architecture

Files

  • src/main_ml.py: Core trading bot (512 lines)
  • src/web_dashboard.py: FastAPI dashboard (650+ lines)
  • README.md: This file

Endpoints

  • Bot: Runs async trading cycle (5s loop)
  • Dashboard: http://localhost:7000 (HTML) + /api/state (JSON)
  • Telegram: Real-time alerts

Configuration

Strategy Parameters (Adaptive)

SIGNAL_THRESHOLD: 5-10%
INVESTMENT_PERCENT: 50-55%
TAKE_PROFIT_PERCENT: 1.5-3.5%
STOP_LOSS_PERCENT: 1.0-2.2%
MAX_TRADES_PER_DAY: 5-25
MAX_OPEN_POSITIONS: 1-2

Risk Controls

  • Daily Loss Limit: -5%
  • Max 3 consecutive losses → 30min cooldown
  • Min notional: $5.00 per order
  • Slippage buffer: PRICE_FILTER rounding

Usage

Start Bot

cd src
python3 main_ml.py

Start Dashboard

cd src
uvicorn web_dashboard:app --host 0.0.0.0 --port 7000

View Dashboard

http://bot.bizmark.cloud

Performance

Current State (2026-07-07)

  • Portfolio: $135.99 USD
  • P&L: -$1.83 (-1.3%)
  • Open Positions: 1 (XRP 6.7 @ $1.15)
  • Status: 🟢 LIVE

Historical

  • Total Trades: 10+
  • Win Rate: 45-55% (adaptive mode active)
  • Largest Win: +2.8% (TP hit)
  • Largest Loss: -1.8% (SL hit)

Version History

V0.2 (Current) — 2026-07-07

  • Adaptive strategy learning (Option 2)
  • Live P&L dashboard integration
  • 10s refresh rate (optimized)
  • Hourly strategy evaluation
  • Code cleanup (removed V5/V10 labels)

V0.1 (Previous)

  • Static strategy (7.5% signal, 50% investment)
  • Basic P&L cart add reporting

Troubleshooting

Dashboard shows stale P&L?

  • Check /api/state endpoint returns new data
  • Verify bot is running (systemctl status trading-bot)
  • Refresh page (clears 10s cache)

Bot not trading?

  • Check daily loss limit (-5% limit may be hit)
  • Verify Binance API key has trading permission
  • Check MIN_NOTIONAL ($5.00 minimum per order)

Strategy not adapting?

  • Need minimum 5 trades to trigger adaptation
  • Strategy updates every hour (check logs)
  • Win rate must be >5% points away to trigger new mode

License

All trades at your own risk. Crypto is volatile.