rename fix and build fixes
This commit is contained in:
60
.vscode/launch.json
vendored
60
.vscode/launch.json
vendored
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
<<<<<<< HEAD
|
||||
{
|
||||
"name": "📊 Dashboard (Real-time + Training)",
|
||||
"type": "python",
|
||||
@@ -20,15 +19,10 @@
|
||||
},
|
||||
"preLaunchTask": "Kill Stale Processes"
|
||||
},
|
||||
|
||||
=======
|
||||
|
||||
>>>>>>> d49a473ed6f4aef55bfdd47d6370e53582be6b7b
|
||||
{
|
||||
"name": "🔬 Backtest Training (30 days)",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
<<<<<<< HEAD
|
||||
"program": "main_backtest.py",
|
||||
"args": [
|
||||
"--start",
|
||||
@@ -57,14 +51,10 @@
|
||||
"--symbol",
|
||||
"ETH/USDT"
|
||||
],
|
||||
=======
|
||||
"program": "run_clean_dashboard.py",
|
||||
>>>>>>> d49a473ed6f4aef55bfdd47d6370e53582be6b7b
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false,
|
||||
"env": {
|
||||
"PYTHONUNBUFFERED": "1",
|
||||
<<<<<<< HEAD
|
||||
"CUDA_VISIBLE_DEVICES": "0"
|
||||
}
|
||||
},
|
||||
@@ -89,12 +79,6 @@
|
||||
"PYTHONUNBUFFERED": "1"
|
||||
}
|
||||
},
|
||||
=======
|
||||
"ENABLE_REALTIME_CHARTS": "1"
|
||||
}
|
||||
},
|
||||
|
||||
>>>>>>> d49a473ed6f4aef55bfdd47d6370e53582be6b7b
|
||||
{
|
||||
"name": "🏗️ Python Debugger: Current File",
|
||||
"type": "debugpy",
|
||||
@@ -106,6 +90,21 @@
|
||||
"PYTHONUNBUFFERED": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "📝 ANNOTATE Manual Trade Annotation UI",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "ANNOTATE/web/app.py",
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false,
|
||||
"env": {
|
||||
"PYTHONUNBUFFERED": "1",
|
||||
"FLASK_ENV": "development",
|
||||
"FLASK_DEBUG": "1"
|
||||
},
|
||||
"cwd": "${workspaceFolder}",
|
||||
"preLaunchTask": "Kill Stale Processes"
|
||||
},
|
||||
{
|
||||
"name": "📈 COB Data Provider Dashboard",
|
||||
"type": "python",
|
||||
@@ -120,7 +119,6 @@
|
||||
},
|
||||
"preLaunchTask": "Kill Stale Processes"
|
||||
},
|
||||
<<<<<<< HEAD
|
||||
{
|
||||
"name": "🔥 Real-time RL COB Trader",
|
||||
"type": "python",
|
||||
@@ -153,9 +151,6 @@
|
||||
},
|
||||
"preLaunchTask": "Kill Stale Processes"
|
||||
},
|
||||
=======
|
||||
|
||||
>>>>>>> d49a473ed6f4aef55bfdd47d6370e53582be6b7b
|
||||
{
|
||||
"name": "🧪 Run Tests",
|
||||
"type": "python",
|
||||
@@ -204,11 +199,6 @@
|
||||
"order": 3
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
|
||||
>>>>>>> d49a473ed6f4aef55bfdd47d6370e53582be6b7b
|
||||
],
|
||||
"compounds": [
|
||||
{
|
||||
@@ -225,36 +215,22 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
"name": "🔥 COB Trading System",
|
||||
"configurations": [
|
||||
"📈 COB Data Provider Dashboard",
|
||||
"🔥 Real-time RL COB Trader"
|
||||
=======
|
||||
"name": "💹 Live Trading System (Dashboard + Monitor)",
|
||||
"configurations": [
|
||||
"💹 Live Scalping Dashboard (500x Leverage)",
|
||||
"🌙 Overnight Training Monitor (504M Model)"
|
||||
>>>>>>> d49a473ed6f4aef55bfdd47d6370e53582be6b7b
|
||||
],
|
||||
"stopAll": true,
|
||||
"presentation": {
|
||||
"hidden": false,
|
||||
<<<<<<< HEAD
|
||||
"group": "COB",
|
||||
"order": 2
|
||||
}
|
||||
}
|
||||
=======
|
||||
"group": "Trading",
|
||||
"order": 2
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"name": "🌐 COBY Multi-Exchange System (Full Stack)",
|
||||
"configurations": [
|
||||
"🌐 COBY Multi-Exchange Data Aggregation"
|
||||
"🔧 COBY Development Mode (Auto-reload) - main"
|
||||
],
|
||||
"stopAll": true,
|
||||
"presentation": {
|
||||
@@ -266,7 +242,7 @@
|
||||
{
|
||||
"name": "🔧 COBY Development Environment",
|
||||
"configurations": [
|
||||
"🔧 COBY Development Mode (Auto-reload)"
|
||||
"🔧 COBY Development Mode (Auto-reload) - main"
|
||||
],
|
||||
"stopAll": true,
|
||||
"presentation": {
|
||||
@@ -275,7 +251,5 @@
|
||||
"order": 7
|
||||
}
|
||||
}
|
||||
|
||||
>>>>>>> d49a473ed6f4aef55bfdd47d6370e53582be6b7b
|
||||
]
|
||||
}
|
||||
@@ -44,12 +44,12 @@ ANNOTATE/
|
||||
pip install dash plotly pandas numpy
|
||||
|
||||
# Run the application
|
||||
python TESTCASES/web/app.py
|
||||
python ANNOTATE/web/app.py
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
1. **Start the application**: Run `python TESTCASES/web/app.py`
|
||||
1. **Start the application**: Run `python ANNOTATE/web/app.py`
|
||||
2. **Open browser**: Navigate to `http://localhost:8051`
|
||||
3. **Select symbol and timeframe**: Choose trading pair and timeframes to display
|
||||
4. **Navigate to time period**: Use date picker or scroll to find market conditions
|
||||
@@ -74,10 +74,10 @@ This sub-project is designed to be self-contained but can be integrated with the
|
||||
|
||||
```python
|
||||
# Import annotation manager in main system
|
||||
from TESTCASES.core.annotation_manager import AnnotationManager
|
||||
from ANNOTATE.core.annotation_manager import AnnotationManager
|
||||
|
||||
# Import training simulator
|
||||
from TESTCASES.core.training_simulator import TrainingSimulator
|
||||
from ANNOTATE.core.training_simulator import TrainingSimulator
|
||||
|
||||
# Use generated test cases in training
|
||||
test_cases = annotation_manager.get_test_cases()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
TESTCASES Core Module
|
||||
ANNOTATE Core Module
|
||||
|
||||
Core business logic for the Manual Trade Annotation UI
|
||||
"""
|
||||
|
||||
@@ -39,7 +39,7 @@ class TradeAnnotation:
|
||||
class AnnotationManager:
|
||||
"""Manages trade annotations and test case generation"""
|
||||
|
||||
def __init__(self, storage_path: str = "TESTCASES/data/annotations"):
|
||||
def __init__(self, storage_path: str = "ANNOTATE/data/annotations"):
|
||||
"""Initialize annotation manager"""
|
||||
self.storage_path = Path(storage_path)
|
||||
self.storage_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
@@ -54,7 +54,7 @@ class TrainingSimulator:
|
||||
self.training_sessions = {}
|
||||
|
||||
# Storage for training results
|
||||
self.results_dir = Path("TESTCASES/data/training_results")
|
||||
self.results_dir = Path("ANNOTATE/data/training_results")
|
||||
self.results_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
logger.info("TrainingSimulator initialized")
|
||||
|
||||
BIN
ANNOTATE/data/trading_system.db
Normal file
BIN
ANNOTATE/data/trading_system.db
Normal file
Binary file not shown.
@@ -31,9 +31,9 @@ except ImportError as e:
|
||||
TradingOrchestrator = None
|
||||
get_config = lambda: {}
|
||||
|
||||
# Import TESTCASES modules
|
||||
testcases_dir = Path(__file__).parent.parent
|
||||
sys.path.insert(0, str(testcases_dir))
|
||||
# Import ANNOTATE modules
|
||||
annotate_dir = Path(__file__).parent.parent
|
||||
sys.path.insert(0, str(annotate_dir))
|
||||
|
||||
try:
|
||||
from core.annotation_manager import AnnotationManager
|
||||
@@ -45,7 +45,7 @@ except ImportError:
|
||||
# Load annotation_manager
|
||||
ann_spec = importlib.util.spec_from_file_location(
|
||||
"annotation_manager",
|
||||
testcases_dir / "core" / "annotation_manager.py"
|
||||
annotate_dir / "core" / "annotation_manager.py"
|
||||
)
|
||||
ann_module = importlib.util.module_from_spec(ann_spec)
|
||||
ann_spec.loader.exec_module(ann_module)
|
||||
@@ -54,7 +54,7 @@ except ImportError:
|
||||
# Load training_simulator
|
||||
train_spec = importlib.util.spec_from_file_location(
|
||||
"training_simulator",
|
||||
testcases_dir / "core" / "training_simulator.py"
|
||||
annotate_dir / "core" / "training_simulator.py"
|
||||
)
|
||||
train_module = importlib.util.module_from_spec(train_spec)
|
||||
train_spec.loader.exec_module(train_module)
|
||||
@@ -82,7 +82,7 @@ class AnnotationDashboard:
|
||||
static_folder='static'
|
||||
)
|
||||
|
||||
# Initialize Dash app
|
||||
# Initialize Dash app (optional component)
|
||||
self.app = Dash(
|
||||
__name__,
|
||||
server=self.server,
|
||||
@@ -93,13 +93,23 @@ class AnnotationDashboard:
|
||||
]
|
||||
)
|
||||
|
||||
# Set a simple Dash layout to avoid NoLayoutException
|
||||
self.app.layout = html.Div([
|
||||
html.H1("ANNOTATE Dashboard", className="text-center mb-4"),
|
||||
html.Div([
|
||||
html.P("This is the Dash component of the ANNOTATE system."),
|
||||
html.P("The main interface is available at the Flask routes."),
|
||||
html.A("Go to Main Interface", href="/", className="btn btn-primary")
|
||||
], className="container")
|
||||
])
|
||||
|
||||
# Initialize core components
|
||||
self.data_provider = DataProvider() if DataProvider else None
|
||||
self.orchestrator = TradingOrchestrator(
|
||||
data_provider=self.data_provider
|
||||
) if TradingOrchestrator and self.data_provider else None
|
||||
|
||||
# Initialize TESTCASES components
|
||||
# Initialize ANNOTATE components
|
||||
self.annotation_manager = AnnotationManager()
|
||||
self.training_simulator = TrainingSimulator(self.orchestrator) if self.orchestrator else None
|
||||
|
||||
@@ -114,6 +124,7 @@ class AnnotationDashboard:
|
||||
@self.server.route('/')
|
||||
def index():
|
||||
"""Main dashboard page"""
|
||||
try:
|
||||
# Get current annotations
|
||||
annotations = self.annotation_manager.get_annotations()
|
||||
|
||||
@@ -126,6 +137,52 @@ class AnnotationDashboard:
|
||||
}
|
||||
|
||||
return render_template('annotation_dashboard.html', **template_data)
|
||||
except Exception as e:
|
||||
logger.error(f"Error rendering main page: {e}")
|
||||
# Fallback simple HTML page
|
||||
return f"""
|
||||
<html>
|
||||
<head>
|
||||
<title>ANNOTATE - Manual Trade Annotation UI</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container mt-5">
|
||||
<h1 class="text-center">📝 ANNOTATE - Manual Trade Annotation UI</h1>
|
||||
<div class="alert alert-info">
|
||||
<h4>System Status</h4>
|
||||
<p>✅ Annotation Manager: Active</p>
|
||||
<p>⚠️ Data Provider: {'Available' if self.data_provider else 'Not Available (Standalone Mode)'}</p>
|
||||
<p>⚠️ Trading Orchestrator: {'Available' if self.orchestrator else 'Not Available (Standalone Mode)'}</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3>Available Features</h3>
|
||||
<ul>
|
||||
<li>Manual trade annotation</li>
|
||||
<li>Test case generation</li>
|
||||
<li>Annotation export</li>
|
||||
<li>Training simulation</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h3>API Endpoints</h3>
|
||||
<ul>
|
||||
<li><code>POST /api/chart-data</code> - Get chart data</li>
|
||||
<li><code>POST /api/save-annotation</code> - Save annotation</li>
|
||||
<li><code>POST /api/delete-annotation</code> - Delete annotation</li>
|
||||
<li><code>POST /api/generate-test-case</code> - Generate test case</li>
|
||||
<li><code>POST /api/export-annotations</code> - Export annotations</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center mt-4">
|
||||
<a href="/dash/" class="btn btn-primary">Go to Dash Interface</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
||||
@self.server.route('/api/chart-data', methods=['POST'])
|
||||
def get_chart_data():
|
||||
|
||||
Reference in New Issue
Block a user