🤖 COMPLETE: Learning-Enhanced AI with HTTP Compatibility
LEARNING INTEGRATION: - Enhanced AI analysis service feeds historical data into OpenAI prompts - Symbol/timeframe specific learning optimization - Pattern recognition from past trade outcomes - Confidence adjustment based on success rates HTTP COMPATIBILITY SYSTEM: - HttpUtil with automatic curl/no-curl detection - Node.js fallback for Docker environments without curl - Updated all automation systems to use HttpUtil - Production-ready error handling AUTONOMOUS RISK MANAGEMENT: - Enhanced risk manager with learning integration - Simplified learners using existing AILearningData schema - Real-time position monitoring every 30 seconds - Smart stop-loss decisions with AI learning INFRASTRUCTURE: - Database utility for shared Prisma connections - Beach mode status display system - Complete error handling and recovery - Docker container compatibility tested Historical performance flows into OpenAI prompts before every trade.
This commit is contained in:
@@ -6,9 +6,7 @@
|
||||
* A lightweight version that monitors positions without complex fetch operations
|
||||
*/
|
||||
|
||||
const { exec } = require('child_process');
|
||||
const util = require('util');
|
||||
const execAsync = util.promisify(exec);
|
||||
const HttpUtil = require('./http-util');
|
||||
|
||||
class StableRiskMonitor {
|
||||
constructor() {
|
||||
@@ -23,9 +21,7 @@ class StableRiskMonitor {
|
||||
|
||||
async checkPosition() {
|
||||
try {
|
||||
// Use curl instead of fetch for better Node.js compatibility
|
||||
const { stdout } = await execAsync('curl -s http://localhost:9001/api/automation/position-monitor');
|
||||
const data = JSON.parse(stdout);
|
||||
const data = await HttpUtil.get('http://localhost:9001/api/automation/position-monitor');
|
||||
|
||||
if (data.success && data.monitor) {
|
||||
return this.analyzeRisk(data.monitor);
|
||||
|
||||
Reference in New Issue
Block a user