Add Dashboard Autostart Setup for Windows
- start_dashboard.bat: Manual start with console output - start_dashboard_silent.bat: Silent background start - install_dashboard_autostart.bat: One-click autostart installation - uninstall_dashboard_autostart.bat: Remove autostart - DASHBOARD_AUTOSTART_SETUP.md: Complete documentation Features: - Automatic startup on Windows login - Opens browser at http://localhost:8501 - Silent background execution - Easy install/uninstall - Troubleshooting guide included
This commit is contained in:
@@ -0,0 +1,289 @@
|
||||
# 📊 Trading Bot Dashboard - Autostart Setup
|
||||
|
||||
## 🎯 Übersicht
|
||||
|
||||
Das Dashboard kann automatisch beim Windows-Login starten, sodass Sie immer sofort Zugriff auf Ihre Trading-Daten haben.
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Installation (2 Minuten)
|
||||
|
||||
### Option A: Automatische Installation (EMPFOHLEN)
|
||||
|
||||
1. **Doppelklick auf**: [install_dashboard_autostart.bat](install_dashboard_autostart.bat)
|
||||
2. **Bestätigen Sie** die Installation
|
||||
3. **Fertig!** Ab nächstem Login startet Dashboard automatisch
|
||||
|
||||
### Option B: Manuelle Installation
|
||||
|
||||
1. **Drücken Sie**: `Windows + R`
|
||||
2. **Tippen Sie**: `shell:startup` + ENTER
|
||||
3. **Autostart-Ordner öffnet sich**
|
||||
4. **Erstellen Sie Verknüpfung** zu `start_dashboard_silent.bat`
|
||||
|
||||
---
|
||||
|
||||
## 📋 Verfügbare Scripts
|
||||
|
||||
### 1️⃣ [start_dashboard.bat](start_dashboard.bat)
|
||||
**Manueller Start mit Konsole**
|
||||
|
||||
- ✅ Zeigt Debug-Ausgaben
|
||||
- ✅ Öffnet Browser automatisch
|
||||
- ✅ Gut für Troubleshooting
|
||||
- ⚠️ Konsolen-Fenster bleibt offen
|
||||
|
||||
**Verwendung**:
|
||||
```
|
||||
Doppelklick auf start_dashboard.bat
|
||||
```
|
||||
|
||||
### 2️⃣ [start_dashboard_silent.bat](start_dashboard_silent.bat)
|
||||
**Hintergrund-Start ohne Fenster**
|
||||
|
||||
- ✅ Kein Konsolen-Fenster
|
||||
- ✅ Öffnet Browser automatisch
|
||||
- ✅ Läuft im Hintergrund
|
||||
- ✅ Perfekt für Autostart
|
||||
|
||||
**Verwendung**:
|
||||
```
|
||||
Für Autostart empfohlen
|
||||
```
|
||||
|
||||
### 3️⃣ [install_dashboard_autostart.bat](install_dashboard_autostart.bat)
|
||||
**Autostart Installation**
|
||||
|
||||
- ✅ Erstellt Verknüpfung im Autostart
|
||||
- ✅ Automatische Konfiguration
|
||||
- ✅ Prüft vorhandene Installation
|
||||
|
||||
**Verwendung**:
|
||||
```
|
||||
Einmalig ausführen zum Installieren
|
||||
```
|
||||
|
||||
### 4️⃣ [uninstall_dashboard_autostart.bat](uninstall_dashboard_autostart.bat)
|
||||
**Autostart Deinstallation**
|
||||
|
||||
- ✅ Entfernt Autostart-Verknüpfung
|
||||
- ✅ Saubere Deinstallation
|
||||
|
||||
**Verwendung**:
|
||||
```
|
||||
Falls Sie Autostart nicht mehr wollen
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Was passiert beim Autostart?
|
||||
|
||||
### Beim Windows-Login:
|
||||
|
||||
1. ✅ **Windows startet** → Autostart-Ordner wird ausgeführt
|
||||
2. ✅ **Dashboard startet** im Hintergrund (kein Fenster)
|
||||
3. ✅ **Streamlit läuft** auf `http://localhost:8501`
|
||||
4. ✅ **Browser öffnet** automatisch nach 5 Sekunden
|
||||
|
||||
### Ergebnis:
|
||||
|
||||
**Sofortiger Zugriff auf Dashboard!**
|
||||
- Trading-Übersicht
|
||||
- Live-Positionen
|
||||
- Performance-Statistiken
|
||||
- Equity Curve
|
||||
- Win Rate & Drawdown
|
||||
|
||||
---
|
||||
|
||||
## 🌐 Dashboard aufrufen
|
||||
|
||||
### Nach Autostart:
|
||||
```
|
||||
http://localhost:8501
|
||||
```
|
||||
|
||||
### Oder manuell im Browser:
|
||||
1. Öffnen Sie Chrome/Firefox/Edge
|
||||
2. Navigieren Sie zu: `http://localhost:8501`
|
||||
|
||||
---
|
||||
|
||||
## ❓ Troubleshooting
|
||||
|
||||
### Dashboard startet nicht beim Login
|
||||
|
||||
**Prüfen Sie**:
|
||||
```
|
||||
1. Windows + R
|
||||
2. shell:startup
|
||||
3. Ist "Trading Bot Dashboard.lnk" vorhanden?
|
||||
```
|
||||
|
||||
**Falls nicht vorhanden**:
|
||||
- Führen Sie `install_dashboard_autostart.bat` erneut aus
|
||||
|
||||
### Dashboard läuft, aber Browser öffnet nicht
|
||||
|
||||
**Öffnen Sie manuell**:
|
||||
```
|
||||
http://localhost:8501
|
||||
```
|
||||
|
||||
### "Streamlit not found" Fehler
|
||||
|
||||
**Installieren Sie Streamlit**:
|
||||
```bash
|
||||
pip install streamlit plotly
|
||||
```
|
||||
|
||||
**Oder verwenden Sie**: [start_dashboard.bat](start_dashboard.bat)
|
||||
- Installiert Streamlit automatisch bei Bedarf
|
||||
|
||||
### Port 8501 bereits belegt
|
||||
|
||||
**Prüfen Sie laufende Instanzen**:
|
||||
```bash
|
||||
netstat -ano | findstr :8501
|
||||
```
|
||||
|
||||
**Beenden Sie alte Prozesse**:
|
||||
```bash
|
||||
taskkill /PID <PID> /F
|
||||
```
|
||||
|
||||
### Dashboard zeigt keine Daten
|
||||
|
||||
**Prüfen Sie**:
|
||||
1. Ist `trading_bot.db` im gleichen Verzeichnis?
|
||||
2. Enthält Datenbank Trades?
|
||||
|
||||
```python
|
||||
import sqlite3
|
||||
conn = sqlite3.connect('trading_bot.db')
|
||||
cursor = conn.cursor()
|
||||
cursor.execute('SELECT COUNT(*) FROM trades')
|
||||
print(f"Trades in DB: {cursor.fetchone()[0]}")
|
||||
conn.close()
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🛑 Dashboard beenden
|
||||
|
||||
### Option 1: Task-Manager
|
||||
1. **STRG + SHIFT + ESC**
|
||||
2. **Suchen Sie**: `python` oder `streamlit`
|
||||
3. **Klick rechts** → "Task beenden"
|
||||
|
||||
### Option 2: Kommandozeile
|
||||
```bash
|
||||
# Finde Streamlit-Prozess
|
||||
tasklist | findstr streamlit
|
||||
|
||||
# Beende Prozess
|
||||
taskkill /IM python.exe /F
|
||||
```
|
||||
|
||||
### Option 3: Im Konsolen-Fenster (falls geöffnet)
|
||||
```
|
||||
STRG + C
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔄 Dashboard neu starten
|
||||
|
||||
### Nach Änderungen an Datenbank:
|
||||
1. **Beenden Sie** Dashboard (siehe oben)
|
||||
2. **Starten Sie neu**: [start_dashboard.bat](start_dashboard.bat)
|
||||
|
||||
### Auto-Refresh nutzen:
|
||||
- Dashboard hat **Auto-Refresh Checkbox**
|
||||
- Aktualisiert alle 30 Sekunden automatisch
|
||||
|
||||
---
|
||||
|
||||
## 📊 Dashboard Features
|
||||
|
||||
### Übersicht:
|
||||
- ✅ **Live-Positionen** (offene Trades)
|
||||
- ✅ **Performance-Metriken** (Win Rate, Profit Factor, etc.)
|
||||
- ✅ **Equity Curve** (Konto-Entwicklung)
|
||||
- ✅ **Drawdown-Analyse**
|
||||
- ✅ **Session-Performance** (Asian, London, NY)
|
||||
- ✅ **Trade-Historie** (alle Trades)
|
||||
|
||||
### Interaktiv:
|
||||
- 🔄 **Refresh Button** - Daten manuell aktualisieren
|
||||
- 📅 **Datumsfilter** - Zeitraum auswählen
|
||||
- 📊 **Trade-Filter** - Live vs. Historical
|
||||
- ⚙️ **Auto-Refresh** - Automatische Aktualisierung
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Empfohlene Nutzung
|
||||
|
||||
### Für Live-Trading:
|
||||
1. ✅ **Autostart aktivieren** (immer verfügbar)
|
||||
2. ✅ **Auto-Refresh aktivieren** (Live-Updates)
|
||||
3. ✅ **Browser-Tab pinnen** (schneller Zugriff)
|
||||
|
||||
### Für Entwicklung:
|
||||
1. ✅ **Manueller Start** mit [start_dashboard.bat](start_dashboard.bat)
|
||||
2. ✅ **Konsole beobachten** (Debug-Infos)
|
||||
3. ✅ **Neustart bei Änderungen**
|
||||
|
||||
---
|
||||
|
||||
## 🆘 Support
|
||||
|
||||
### Dashboard startet nicht:
|
||||
```bash
|
||||
# Prüfen Sie Dependencies
|
||||
pip list | findstr streamlit
|
||||
pip list | findstr plotly
|
||||
|
||||
# Installieren falls fehlend
|
||||
pip install streamlit plotly pandas
|
||||
```
|
||||
|
||||
### Performance-Probleme:
|
||||
- **Cache leeren**: Klick auf "Refresh Data" Button
|
||||
- **Browser-Cache leeren**: STRG + F5
|
||||
- **Dashboard neu starten**
|
||||
|
||||
### Daten veraltet:
|
||||
- **Auto-Refresh**: Checkbox aktivieren
|
||||
- **Manuell**: "Refresh Data" Button klicken
|
||||
- **Cache-Zeit**: 30 Sekunden (Standard)
|
||||
|
||||
---
|
||||
|
||||
## 📋 Zusammenfassung
|
||||
|
||||
### Installation:
|
||||
1. Doppelklick: [install_dashboard_autostart.bat](install_dashboard_autostart.bat)
|
||||
2. Bestätigen
|
||||
3. Fertig!
|
||||
|
||||
### Deinstallation:
|
||||
1. Doppelklick: [uninstall_dashboard_autostart.bat](uninstall_dashboard_autostart.bat)
|
||||
2. Bestätigen
|
||||
3. Fertig!
|
||||
|
||||
### Manueller Start:
|
||||
- **Mit Konsole**: [start_dashboard.bat](start_dashboard.bat)
|
||||
- **Im Hintergrund**: [start_dashboard_silent.bat](start_dashboard_silent.bat)
|
||||
|
||||
### URL:
|
||||
```
|
||||
http://localhost:8501
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Erstellt**: 2025-12-23
|
||||
**Version**: 1.0
|
||||
**Kompatibel mit**: TradingBot V1.8 Dashboard
|
||||
**Python-Anforderungen**: streamlit, plotly, pandas, sqlite3
|
||||
@@ -0,0 +1,77 @@
|
||||
@echo off
|
||||
REM ==========================================
|
||||
REM Dashboard Autostart Installation
|
||||
REM Erstellt Verknüpfung im Autostart-Ordner
|
||||
REM ==========================================
|
||||
|
||||
echo.
|
||||
echo ========================================
|
||||
echo Dashboard Autostart Installation
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
REM Pfade
|
||||
set "SCRIPT_DIR=%~dp0"
|
||||
set "STARTUP_FOLDER=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup"
|
||||
set "SHORTCUT_NAME=Trading Bot Dashboard.lnk"
|
||||
set "SHORTCUT_PATH=%STARTUP_FOLDER%\%SHORTCUT_NAME%"
|
||||
|
||||
echo [INFO] Script-Verzeichnis: %SCRIPT_DIR%
|
||||
echo [INFO] Autostart-Ordner: %STARTUP_FOLDER%
|
||||
echo.
|
||||
|
||||
REM Prüfe ob bereits installiert
|
||||
if exist "%SHORTCUT_PATH%" (
|
||||
echo [WARNUNG] Autostart bereits installiert!
|
||||
echo [INFO] Vorhandene Verknüpfung: %SHORTCUT_PATH%
|
||||
echo.
|
||||
choice /C JN /M "Möchten Sie die Verknüpfung neu erstellen?"
|
||||
if errorlevel 2 (
|
||||
echo [INFO] Abgebrochen
|
||||
pause
|
||||
exit /b 0
|
||||
)
|
||||
echo [INFO] Lösche alte Verknüpfung...
|
||||
del "%SHORTCUT_PATH%"
|
||||
)
|
||||
|
||||
REM Erstelle VBScript zum Erstellen der Verknüpfung
|
||||
set "VBS_SCRIPT=%TEMP%\create_shortcut.vbs"
|
||||
echo Set oWS = WScript.CreateObject("WScript.Shell") > "%VBS_SCRIPT%"
|
||||
echo sLinkFile = "%SHORTCUT_PATH%" >> "%VBS_SCRIPT%"
|
||||
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> "%VBS_SCRIPT%"
|
||||
echo oLink.TargetPath = "%SCRIPT_DIR%start_dashboard_silent.bat" >> "%VBS_SCRIPT%"
|
||||
echo oLink.WorkingDirectory = "%SCRIPT_DIR%" >> "%VBS_SCRIPT%"
|
||||
echo oLink.Description = "Trading Bot Dashboard - Autostart" >> "%VBS_SCRIPT%"
|
||||
echo oLink.IconLocation = "shell32.dll,13" >> "%VBS_SCRIPT%"
|
||||
echo oLink.Save >> "%VBS_SCRIPT%"
|
||||
|
||||
echo [INFO] Erstelle Verknüpfung...
|
||||
cscript //nologo "%VBS_SCRIPT%"
|
||||
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] Verknüpfung konnte nicht erstellt werden!
|
||||
del "%VBS_SCRIPT%"
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM Aufräumen
|
||||
del "%VBS_SCRIPT%"
|
||||
|
||||
echo.
|
||||
echo ========================================
|
||||
echo Installation erfolgreich!
|
||||
echo ========================================
|
||||
echo.
|
||||
echo [OK] Dashboard startet ab jetzt automatisch beim Login
|
||||
echo.
|
||||
echo Verknüpfung erstellt:
|
||||
echo %SHORTCUT_PATH%
|
||||
echo.
|
||||
echo Ziel:
|
||||
echo %SCRIPT_DIR%start_dashboard_silent.bat
|
||||
echo.
|
||||
echo [TIPP] Dashboard-URL nach Login: http://localhost:8501
|
||||
echo.
|
||||
pause
|
||||
@@ -0,0 +1,79 @@
|
||||
@echo off
|
||||
REM ==========================================
|
||||
REM Trading Bot Dashboard - Autostart Script
|
||||
REM ==========================================
|
||||
|
||||
echo.
|
||||
echo ========================================
|
||||
echo Trading Bot Dashboard Starter
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
REM Wechsel ins Bot-Verzeichnis
|
||||
cd /d "%~dp0"
|
||||
echo [INFO] Working Directory: %CD%
|
||||
echo.
|
||||
|
||||
REM Prüfe ob Python verfügbar ist
|
||||
python --version >nul 2>&1
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] Python nicht gefunden!
|
||||
echo [ERROR] Bitte Python installieren oder PATH prüfen.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [OK] Python gefunden
|
||||
echo.
|
||||
|
||||
REM Prüfe ob Streamlit installiert ist
|
||||
python -c "import streamlit" >nul 2>&1
|
||||
if errorlevel 1 (
|
||||
echo [WARNUNG] Streamlit nicht installiert!
|
||||
echo [INFO] Installiere Streamlit...
|
||||
pip install streamlit plotly
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] Installation fehlgeschlagen!
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
|
||||
echo [OK] Streamlit verfügbar
|
||||
echo.
|
||||
|
||||
REM Prüfe ob Dashboard-Datei existiert
|
||||
if not exist "trading_dashboard.py" (
|
||||
echo [ERROR] trading_dashboard.py nicht gefunden!
|
||||
echo [ERROR] Bitte im richtigen Verzeichnis ausführen.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [OK] Dashboard-Datei gefunden
|
||||
echo.
|
||||
|
||||
REM Prüfe ob Datenbank existiert
|
||||
if not exist "trading_bot.db" (
|
||||
echo [WARNUNG] trading_bot.db nicht gefunden!
|
||||
echo [WARNUNG] Dashboard startet, aber keine Daten verfügbar.
|
||||
echo.
|
||||
)
|
||||
|
||||
echo ========================================
|
||||
echo Starte Dashboard...
|
||||
echo ========================================
|
||||
echo.
|
||||
echo URL: http://localhost:8501
|
||||
echo.
|
||||
echo [TIPP] Browser öffnet automatisch
|
||||
echo [TIPP] Zum Beenden: STRG+C drücken
|
||||
echo.
|
||||
|
||||
REM Starte Streamlit Dashboard
|
||||
streamlit run trading_dashboard.py --server.port 8501 --server.headless false
|
||||
|
||||
REM Falls Streamlit beendet wird
|
||||
echo.
|
||||
echo [INFO] Dashboard wurde beendet
|
||||
pause
|
||||
@@ -0,0 +1,19 @@
|
||||
@echo off
|
||||
REM ==========================================
|
||||
REM Trading Bot Dashboard - Silent Autostart
|
||||
REM Startet im Hintergrund ohne Fenster
|
||||
REM ==========================================
|
||||
|
||||
REM Wechsel ins Bot-Verzeichnis
|
||||
cd /d "%~dp0"
|
||||
|
||||
REM Starte Dashboard im Hintergrund (headless)
|
||||
start /B pythonw -m streamlit run trading_dashboard.py --server.port 8501 --server.headless true
|
||||
|
||||
REM Warte 5 Sekunden
|
||||
timeout /t 5 /nobreak >nul
|
||||
|
||||
REM Öffne Browser
|
||||
start http://localhost:8501
|
||||
|
||||
exit
|
||||
@@ -0,0 +1,57 @@
|
||||
@echo off
|
||||
REM ==========================================
|
||||
REM Dashboard Autostart Deinstallation
|
||||
REM Entfernt Verknüpfung aus Autostart
|
||||
REM ==========================================
|
||||
|
||||
echo.
|
||||
echo ========================================
|
||||
echo Dashboard Autostart Deinstallation
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
set "STARTUP_FOLDER=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup"
|
||||
set "SHORTCUT_NAME=Trading Bot Dashboard.lnk"
|
||||
set "SHORTCUT_PATH=%STARTUP_FOLDER%\%SHORTCUT_NAME%"
|
||||
|
||||
echo [INFO] Suche Autostart-Verknüpfung...
|
||||
echo.
|
||||
|
||||
if not exist "%SHORTCUT_PATH%" (
|
||||
echo [INFO] Keine Autostart-Verknüpfung gefunden
|
||||
echo [INFO] Dashboard ist nicht im Autostart installiert
|
||||
pause
|
||||
exit /b 0
|
||||
)
|
||||
|
||||
echo [GEFUNDEN] %SHORTCUT_PATH%
|
||||
echo.
|
||||
choice /C JN /M "Möchten Sie die Autostart-Verknüpfung entfernen?"
|
||||
if errorlevel 2 (
|
||||
echo [INFO] Abgebrochen
|
||||
pause
|
||||
exit /b 0
|
||||
)
|
||||
|
||||
echo.
|
||||
echo [INFO] Entferne Verknüpfung...
|
||||
del "%SHORTCUT_PATH%"
|
||||
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] Verknüpfung konnte nicht gelöscht werden!
|
||||
echo [ERROR] Möglicherweise fehlende Berechtigungen
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo.
|
||||
echo ========================================
|
||||
echo Deinstallation erfolgreich!
|
||||
echo ========================================
|
||||
echo.
|
||||
echo [OK] Dashboard startet nicht mehr automatisch
|
||||
echo.
|
||||
echo [TIPP] Sie können Dashboard manuell starten mit:
|
||||
echo start_dashboard.bat
|
||||
echo.
|
||||
pause
|
||||
Reference in New Issue
Block a user