Files
trading_bot_v3/app/api/tradingview/route.js
mindesbunister ab6c4fd861 🔥 OBLITERATE ALL MOCK DATA - System now uses 100% real data sources
- 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!
2025-07-30 19:10:25 +02:00

48 lines
1.3 KiB
JavaScript

import { NextResponse } from 'next/server'
export async function POST(request) {
try {
const { symbol, timeframe } = await request.json();
console.log('📊 Capturing REAL TradingView chart for:', symbol, timeframe);
// Use the REAL TradingView automation service
const tradingViewAutomation = require('../../../lib/tradingview-automation');
const result = await tradingViewAutomation.captureChart({
symbol,
timeframe,
layouts: ['ai', 'diy']
});
if (!result.success) {
throw new Error(result.error || 'TradingView capture failed');
}
console.log('📊 REAL TradingView chart captured');
return NextResponse.json({
success: true,
screenshots: result.screenshots,
sessionData: result.sessionData,
source: 'REAL_TRADINGVIEW_AUTOMATION'
});
} catch (error) {
console.error('Error capturing TradingView chart:', error);
return NextResponse.json({
success: false,
error: error.message
}, { status: 500 });
}
}
export async function GET() {
return NextResponse.json({
message: 'TradingView Chart API - Use POST to capture charts',
supportedLayouts: ['ai', 'Diy module'],
supportedTimeframes: ['1', '5', '15', '60', '240', 'D', 'W'],
requiredFields: ['symbol', 'timeframe']
})
}