- DESTROYED: AI analysis fake 5-second responses → Real TradingView screenshots (30-180s) - DESTROYED: Mock trading execution → Real Drift Protocol only - DESTROYED: Fake price data (44.11) → Live CoinGecko API (78.60) - DESTROYED: Mock balance/portfolio → Real Drift account data - DESTROYED: Fake screenshot capture → Real enhanced-screenshot service Live trading only - DESTROYED: Hardcoded market data → Real CoinGecko validation - DESTROYED: Mock chart generation → Real TradingView automation CRITICAL FIXES: AI analysis now takes proper time and analyzes real charts Bearish SOL (-0.74%) will now recommend SHORT positions correctly All trades execute on real Drift account Real-time price feeds from CoinGecko Actual technical analysis from live chart patterns Database reset with fresh AI learning (18k+ entries cleared) Trade confirmation system with ChatGPT integration NO MORE FAKE DATA - TRADING SYSTEM IS NOW REAL!
56 lines
1.6 KiB
JavaScript
56 lines
1.6 KiB
JavaScript
import { NextResponse } from 'next/server'
|
|
|
|
export async function POST(request) {
|
|
try {
|
|
const { symbol, timeframes } = await request.json();
|
|
|
|
console.log('🔍 Getting REAL automated analysis for:', symbol, 'timeframes:', timeframes);
|
|
|
|
// Get REAL analysis from enhanced screenshot system
|
|
const screenshotResponse = await fetch(`${process.env.APP_URL || 'http://localhost:3000'}/api/enhanced-screenshot`, {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({
|
|
symbol,
|
|
timeframes,
|
|
layouts: ['ai', 'diy'],
|
|
analyze: true
|
|
})
|
|
});
|
|
|
|
if (!screenshotResponse.ok) {
|
|
throw new Error('Failed to get real analysis');
|
|
}
|
|
|
|
const analysisData = await screenshotResponse.json();
|
|
|
|
if (!analysisData.success) {
|
|
throw new Error(analysisData.error || 'Analysis failed');
|
|
}
|
|
|
|
return NextResponse.json({
|
|
success: true,
|
|
analysis: analysisData.analysis,
|
|
screenshots: analysisData.screenshots,
|
|
timeframes: timeframes,
|
|
source: 'REAL_SCREENSHOT_ANALYSIS'
|
|
});
|
|
|
|
} catch (error) {
|
|
console.error('Error in automated analysis:', error);
|
|
return NextResponse.json({
|
|
success: false,
|
|
error: error.message
|
|
}, { status: 500 });
|
|
}
|
|
}
|
|
|
|
export async function GET() {
|
|
return NextResponse.json({
|
|
message: 'AI Analysis endpoint - Use POST to perform analysis',
|
|
supportedActions: ['capture_and_analyze', 'capture_multiple'],
|
|
requiredFields: ['symbol', 'timeframe', 'action'],
|
|
optionalFields: ['credentials']
|
|
})
|
|
}
|