cash works again!

This commit is contained in:
Dobromir Popov
2025-05-25 00:28:52 +03:00
parent d418f6ce59
commit cf825239cd
18 changed files with 1970 additions and 1331 deletions

380
.vscode/launch.json vendored
View File

@ -2,251 +2,249 @@
"version": "0.2.0",
"configurations": [
{
"name": "Kill Stale Processes",
"name": "🚀 MASSIVE RL Training (504M Parameters)",
"type": "python",
"request": "launch",
"program": "utils/port_manager.py",
"args": ["--kill-stale"],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
// "program": "realtime.py",
"program": "${file}",
"console": "integratedTerminal",
"preLaunchTask": "Kill Stale Processes"
},
{
"name": "Train Bot",
"type": "python",
"request": "launch",
"program": "main.py",
"program": "main_clean.py",
"args": [
"--mode",
"train",
"--episodes",
"100"
"rl"
],
"console": "integratedTerminal",
"justMyCode": true,
"preLaunchTask": "Kill Stale Processes"
},
{
"name": "Evaluate Bot",
"type": "python",
"request": "launch",
"program": "main.py",
"args": [
"--mode",
"eval",
"--episodes",
"10"
],
"console": "integratedTerminal",
"justMyCode": true,
"preLaunchTask": "Kill Stale Processes"
},
{
"name": "Live Trading (Demo)",
"type": "python",
"request": "launch",
"program": "main.py",
"args": [
"--mode",
"live",
"--demo",
"true",
"--symbol",
"ETH/USDT",
"--timeframe",
"1m"
],
"console": "integratedTerminal",
"justMyCode": true,
"env": {
"PYTHONUNBUFFERED": "1"
},
"preLaunchTask": "Kill Stale Processes"
},
{
"name": "Live Trading (Real)",
"type": "python",
"request": "launch",
"program": "main.py",
"args": [
"--mode",
"live",
"--demo",
"false",
"--symbol",
"ETH/USDT",
"--timeframe",
"1m",
"--leverage",
"50"
],
"console": "integratedTerminal",
"justMyCode": true,
"env": {
"PYTHONUNBUFFERED": "1"
},
"preLaunchTask": "Kill Stale Processes"
},
{
"name": "Live Trading (BTC Futures)",
"type": "python",
"request": "launch",
"program": "main.py",
"args": [
"--mode",
"live",
"--demo",
"false",
"--symbol",
"BTC/USDT",
"--timeframe",
"5m",
"--leverage",
"20"
],
"console": "integratedTerminal",
"justMyCode": true,
"env": {
"PYTHONUNBUFFERED": "1"
},
"preLaunchTask": "Kill Stale Processes"
},
{
"name": "NN Training Pipeline",
"type": "python",
"request": "launch",
"module": "NN.realtime_main",
"args": [
"--mode",
"train",
"--model-type",
"cnn",
"--framework",
"pytorch",
"--symbol",
"BTC/USDT",
"--timeframes",
"1m", "5m", "1h", "4h",
"--epochs",
"10",
"--batch-size",
"32",
"--window-size",
"20",
"--output-size",
"3"
],
"console": "integratedTerminal",
"justMyCode": true,
"justMyCode": false,
"env": {
"PYTHONUNBUFFERED": "1",
"TF_CPP_MIN_LOG_LEVEL": "2"
"CUDA_VISIBLE_DEVICES": "0",
"PYTORCH_CUDA_ALLOC_CONF": "max_split_size_mb:4096"
},
"preLaunchTask": "Kill Stale Processes"
},
{
"name": "🧠 Enhanced CNN Training with Backtesting",
"type": "python",
"request": "launch",
"program": "main_clean.py",
"args": [
"--mode",
"cnn",
"--symbol",
"ETH/USDT"
],
"console": "integratedTerminal",
"justMyCode": false,
"env": {
"PYTHONUNBUFFERED": "1",
"ENABLE_BACKTESTING": "1",
"ENABLE_ANALYSIS": "1",
"CUDA_VISIBLE_DEVICES": "0"
},
"pythonArgs": ["-c", "import sys; sys.path.append('f:/projects/gogo2')"],
"preLaunchTask": "Kill Stale Processes",
"postDebugTask": "Start TensorBoard"
},
{
"name": "Realtime Charts with NN Inference",
"name": "🔥 Hybrid Training (CNN + RL Pipeline)",
"type": "python",
"request": "launch",
"program": "realtime.py",
"program": "main_clean.py",
"args": [
"--mode",
"train"
],
"console": "integratedTerminal",
"justMyCode": true,
"justMyCode": false,
"env": {
"PYTHONUNBUFFERED": "1",
"ENABLE_NN_MODELS": "1",
"NN_INFERENCE_INTERVAL": "60",
"NN_MODEL_TYPE": "cnn",
"NN_TIMEFRAME": "1h"
"CUDA_VISIBLE_DEVICES": "0",
"PYTORCH_CUDA_ALLOC_CONF": "max_split_size_mb:4096",
"ENABLE_HYBRID_TRAINING": "1"
},
"preLaunchTask": "Kill Stale Processes"
"preLaunchTask": "Kill Stale Processes",
"postDebugTask": "Start TensorBoard"
},
{
"name": "Run Scalping Dashboard",
"name": "💹 Live Scalping Dashboard (500x Leverage)",
"type": "python",
"request": "launch",
"program": "run_scalping_dashboard.py",
"args": [
"--episodes",
"100",
"1000",
"--max-position",
"0.1"
"0.1",
"--leverage",
"500"
],
"console": "integratedTerminal",
"justMyCode": true,
"justMyCode": false,
"env": {
"PYTHONUNBUFFERED": "1",
"ENABLE_NN_MODELS": "1",
"NN_INFERENCE_INTERVAL": "60",
"NN_MODEL_TYPE": "cnn",
"NN_TIMEFRAME": "1h"
"ENABLE_MASSIVE_MODEL": "1",
"LEVERAGE_MULTIPLIER": "500",
"SCALPING_MODE": "1"
},
"preLaunchTask": "Kill Stale Processes"
},
{
"name": "TensorBoard (Auto Port)",
"name": "🌙 Overnight Training Monitor (504M Model)",
"type": "python",
"request": "launch",
"program": "utils/launch_tensorboard.py",
"args": [
"--logdir=NN/models/saved/logs",
"--preferred-port=6007",
"--port-range=6000-7000"
],
"program": "overnight_training_monitor.py",
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Realtime RL Training + TensorBoard + Web UI",
"type": "python",
"request": "launch",
"program": "train_realtime_with_tensorboard.py",
"args": [
"--episodes",
"50",
"--symbol",
"ETH/USDT",
"--balance",
"1000.0",
"--web-port",
"8051"
],
"console": "integratedTerminal",
"justMyCode": true,
"justMyCode": false,
"env": {
"PYTHONUNBUFFERED": "1",
"ENABLE_REAL_DATA_ONLY": "1"
},
"preLaunchTask": "Kill Stale Processes"
"MONITOR_INTERVAL": "300",
"ENABLE_PLOTS": "1",
"ENABLE_REPORTS": "1"
}
},
{
"name": "Quick CNN Test (Real Data + TensorBoard)",
"name": "📊 Enhanced Web Dashboard",
"type": "python",
"request": "launch",
"program": "test_cnn_only.py",
"program": "main_clean.py",
"args": [
"--mode",
"web",
"--port",
"8050",
"--demo"
],
"console": "integratedTerminal",
"justMyCode": true,
"justMyCode": false,
"env": {
"PYTHONUNBUFFERED": "1"
"PYTHONUNBUFFERED": "1",
"ENABLE_REALTIME_CHARTS": "1",
"ENABLE_NN_MODELS": "1"
},
"preLaunchTask": "Kill Stale Processes"
},
{
"name": "TensorBoard Monitor (All Runs)",
"name": "🔬 System Test & Validation",
"type": "python",
"request": "launch",
"program": "main_clean.py",
"args": [
"--mode",
"test"
],
"console": "integratedTerminal",
"justMyCode": false,
"env": {
"PYTHONUNBUFFERED": "1",
"TEST_ALL_COMPONENTS": "1"
}
},
{
"name": "📈 TensorBoard Monitor (All Runs)",
"type": "python",
"request": "launch",
"program": "run_tensorboard.py",
"console": "integratedTerminal",
"justMyCode": true
"justMyCode": false
},
{
"name": "🎯 Live Trading (Demo Mode)",
"type": "python",
"request": "launch",
"program": "main_clean.py",
"args": [
"--mode",
"trade",
"--symbol",
"ETH/USDT"
],
"console": "integratedTerminal",
"justMyCode": false,
"env": {
"PYTHONUNBUFFERED": "1",
"DEMO_MODE": "1",
"ENABLE_MASSIVE_MODEL": "1",
"RISK_MANAGEMENT": "1"
},
"preLaunchTask": "Kill Stale Processes"
},
{
"name": "🚨 Model Parameter Audit",
"type": "python",
"request": "launch",
"program": "model_parameter_audit.py",
"console": "integratedTerminal",
"justMyCode": false,
"env": {
"PYTHONUNBUFFERED": "1"
}
},
{
"name": "🧪 CNN Live Training with Analysis",
"type": "python",
"request": "launch",
"program": "training/enhanced_cnn_trainer.py",
"console": "integratedTerminal",
"justMyCode": false,
"env": {
"PYTHONUNBUFFERED": "1",
"ENABLE_BACKTESTING": "1",
"ENABLE_ANALYSIS": "1",
"ENABLE_LIVE_VALIDATION": "1",
"CUDA_VISIBLE_DEVICES": "0"
},
"preLaunchTask": "Kill Stale Processes",
"postDebugTask": "Start TensorBoard"
},
{
"name": "🏗️ Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false,
"env": {
"PYTHONUNBUFFERED": "1"
}
}
],
"compounds": [
{
"name": "🚀 Full Training Pipeline (RL + Monitor + TensorBoard)",
"configurations": [
"🚀 MASSIVE RL Training (504M Parameters)",
"🌙 Overnight Training Monitor (504M Model)",
"📈 TensorBoard Monitor (All Runs)"
],
"stopAll": true,
"presentation": {
"hidden": false,
"group": "Training",
"order": 1
}
},
{
"name": "💹 Live Trading System (Dashboard + Monitor)",
"configurations": [
"💹 Live Scalping Dashboard (500x Leverage)",
"🌙 Overnight Training Monitor (504M Model)"
],
"stopAll": true,
"presentation": {
"hidden": false,
"group": "Trading",
"order": 2
}
},
{
"name": "🧠 CNN Development Pipeline (Training + Analysis)",
"configurations": [
"🧠 Enhanced CNN Training with Backtesting",
"🧪 CNN Live Training with Analysis",
"📈 TensorBoard Monitor (All Runs)"
],
"stopAll": true,
"presentation": {
"hidden": false,
"group": "Development",
"order": 3
}
}
]
}

79
.vscode/tasks.json vendored
View File

@ -1,16 +1,26 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Kill Stale Processes",
"type": "shell",
"command": "python",
"args": [
"-c",
"import psutil; [p.kill() for p in psutil.process_iter() if any(x in p.name().lower() for x in ['python', 'tensorboard']) and any(x in ' '.join(p.cmdline()) for x in ['scalping', 'training', 'tensorboard']) and p.pid != psutil.Process().pid]; print('Stale processes killed')"
],
"presentation": {
"reveal": "silent",
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "Start TensorBoard",
"type": "shell",
"command": "python",
"args": [
"utils/launch_tensorboard.py",
"--logdir=NN/models/saved/logs",
"--preferred-port=6007",
"--port-range=6000-7000",
"--kill-stale"
"run_tensorboard.py"
],
"isBackground": true,
"problemMatcher": {
@ -22,30 +32,75 @@
},
"background": {
"activeOnStart": true,
"beginsPattern": ".*TensorBoard.*",
"endsPattern": ".*TensorBoard available at.*"
"beginsPattern": ".*Starting TensorBoard.*",
"endsPattern": ".*TensorBoard.*available.*"
}
},
"presentation": {
"reveal": "always",
"panel": "new"
"panel": "new",
"group": "monitoring"
},
"runOptions": {
"runOn": "folderOpen"
}
},
{
"label": "Kill Stale Processes",
"label": "Monitor GPU Usage",
"type": "shell",
"command": "python",
"args": [
"utils/port_manager.py",
"--kill-stale"
"-c",
"import GPUtil; import time; [print(f'GPU {gpu.id}: {gpu.load*100:.1f}% load, {gpu.memoryUsed}/{gpu.memoryTotal}MB memory ({gpu.memoryUsed/gpu.memoryTotal*100:.1f}%)') or time.sleep(5) for _ in iter(int, 1) for gpu in GPUtil.getGPUs()]"
],
"isBackground": true,
"presentation": {
"reveal": "always",
"panel": "new",
"group": "monitoring"
},
"problemMatcher": []
},
{
"label": "Check CUDA Setup",
"type": "shell",
"command": "python",
"args": [
"-c",
"import torch; print(f'PyTorch: {torch.__version__}'); print(f'CUDA Available: {torch.cuda.is_available()}'); print(f'CUDA Version: {torch.version.cuda}' if torch.cuda.is_available() else 'CUDA not available'); [print(f'GPU {i}: {torch.cuda.get_device_name(i)}') for i in range(torch.cuda.device_count())] if torch.cuda.is_available() else None"
],
"presentation": {
"reveal": "always",
"panel": "shared"
}
},
"problemMatcher": []
},
{
"label": "Setup Training Environment",
"type": "shell",
"command": "python",
"args": [
"-c",
"import os; os.makedirs('models/rl', exist_ok=True); os.makedirs('models/cnn', exist_ok=True); os.makedirs('logs/overnight_training', exist_ok=True); os.makedirs('reports/overnight_training', exist_ok=True); os.makedirs('plots/overnight_training', exist_ok=True); print('Training directories created')"
],
"presentation": {
"reveal": "silent",
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "Validate Model Parameters",
"type": "shell",
"command": "python",
"args": [
"model_parameter_audit.py"
],
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
}
]
}