RL trainer

This commit is contained in:
Dobromir Popov
2025-05-28 13:20:15 +03:00
parent d6a71c2b1a
commit a6eaa01735
8 changed files with 1476 additions and 132 deletions

View File

@ -1,10 +1,14 @@
# Enhanced Multi-Modal Trading System Configuration
# Trading Symbols (extendable/configurable)
# NOTE: Dashboard live data streaming supports symbols with Binance WebSocket streams
# ETH/USDT is primary trading symbol, BTC/USDT provides correlated market data
# MEXC trading supports: ETH/USDC (not ETH/USDT)
symbols:
- "ETH/USDC" # MEXC supports ETHUSDC for API trading
- "BTC/USDT"
- "MX/USDT"
- "ETH/USDT" # Primary trading symbol - Has live price data via Binance WebSocket
- "BTC/USDT" # Correlated asset for strategy analysis - Has live price data via Binance WebSocket
# - "ETH/USDC" # MEXC supports ETHUSDC for API trading but no live price stream
# - "MX/USDT" # No live price data available
# Timeframes for ultra-fast scalping (500x leverage)
timeframes:
@ -143,6 +147,27 @@ trading:
base_size: 0.02 # 2% base position
max_size: 0.05 # 5% maximum position
# Real-Time RL Learning Configuration
rl_learning:
enabled: true # Enable real-time RL learning from trades
state_size: 100 # Size of state vector for RL agent
learning_rate: 0.0001 # Learning rate for RL agent
gamma: 0.95 # Discount factor for future rewards
epsilon: 0.1 # Exploration rate (low for live trading)
buffer_size: 10000 # Experience replay buffer size
batch_size: 32 # Training batch size
training_frequency: 3 # Train every N completed trades
save_frequency: 50 # Save model every N experiences
min_experiences: 10 # Minimum experiences before training starts
# Reward shaping parameters
time_penalty_threshold: 300 # Seconds before time penalty applies
confidence_bonus_threshold: 0.7 # Confidence level for bonus rewards
# Model persistence
model_save_path: "models/realtime_rl"
auto_load_model: true # Load existing model on startup
# MEXC Trading API Configuration
mexc_trading:
enabled: true # Set to true to enable live trading
@ -165,19 +190,14 @@ mexc_trading:
min_trade_interval_seconds: 30 # Minimum between trades
# Order configuration
order_type: "limit" # Use limit orders (MEXC ETHUSDC requires LIMIT orders)
timeout_seconds: 30 # Order timeout
retry_attempts: 0 # Number of retry attempts for failed orders
order_type: "market" # market or limit orders
# Safety features
require_confirmation: false # No manual confirmation for live trading
emergency_stop: false # Emergency stop all trading
# Advanced features
emergency_stop: false # Emergency stop all trading
allowed_symbols: ["ETH/USDC"] # Allowed trading symbols (MEXC supports ETHUSDC)
# Supported symbols for live trading
allowed_symbols:
- "ETH/USDC" # MEXC supports ETHUSDC for API trading
- "BTC/USDT"
- "MX/USDT"
# Real-time learning integration
rl_learning_enabled: true # Enable RL learning from trade executions
# Trading hours (UTC)
trading_hours: