feat: apply #28B smart breakeven + #31B H1 EMA20 filter, add backtests #26-#32

Live trading optimizations (cumulative: $2,807 net, 81.8% WR, Sharpe 3.97):
- #28B: Smart breakeven locks profit at entry + 0.5x ATR instead of fixed $2
- #31B: H1 Price vs EMA20 filter — BUY only when H1 bullish, SELL only when bearish

Backtests #26-#32 (7 scripts testing sell improvement, regime-aware entry,
confluence scoring, dynamic RR, multi-TF H1, and ML exit optimizer).
Winners: #28B (+$229), #31B (+$343). Failed: #26, #27, #29, #30, #32.

Also includes: web dashboard redesign, Docker setup, startup scripts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
GifariKemal
2026-02-08 10:33:24 +07:00
co-authored by Claude Opus 4.6
parent 53d8cd26a2
commit 214b64945d
64 changed files with 11073 additions and 929 deletions
+54 -4
View File
@@ -1,5 +1,3 @@
version: '3.8'
services:
# PostgreSQL Database
postgres:
@@ -21,8 +19,57 @@ services:
interval: 10s
timeout: 5s
retries: 5
networks:
- trading_bot_network
# pgAdmin (Optional - for database management)
# Trading Bot API (reads bot_status.json from shared volume)
trading-api:
build:
context: .
dockerfile: Dockerfile
container_name: trading_bot_api
restart: unless-stopped
environment:
TZ: Asia/Jakarta
ports:
- "${API_PORT:-8000}:8000"
volumes:
# Mount data/ so API can read bot_status.json written by the bot on host
- ./data:/app/data:ro
depends_on:
postgres:
condition: service_healthy
networks:
- trading_bot_network
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# Web Dashboard (Next.js Frontend)
dashboard:
build:
context: ./web-dashboard
dockerfile: Dockerfile
container_name: trading_bot_dashboard
restart: unless-stopped
ports:
- "${DASHBOARD_PORT:-3000}:3000"
depends_on:
trading-api:
condition: service_healthy
networks:
- trading_bot_network
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
# pgAdmin (OPTIONAL - for database management)
pgadmin:
image: dpage/pgadmin4:latest
container_name: trading_bot_pgadmin
@@ -38,6 +85,8 @@ services:
depends_on:
postgres:
condition: service_healthy
networks:
- trading_bot_network
profiles:
- admin # Only start with: docker-compose --profile admin up
@@ -48,5 +97,6 @@ volumes:
name: trading_bot_pgadmin_data
networks:
default:
trading_bot_network:
name: trading_bot_network
driver: bridge