- Add settings manager to persist symbol, timeframe, and layouts - Support multiple layouts for comprehensive chart analysis - Remove debug screenshots for cleaner logs - Update AI analysis with professional trading prompt - Add multi-screenshot analysis for better trading insights - Update analyze API to use saved settings and multiple layouts
22 lines
652 B
TypeScript
22 lines
652 B
TypeScript
import { NextRequest, NextResponse } from 'next/server'
|
|
import { driftTradingService } from '../../../lib/drift-trading'
|
|
|
|
export async function POST(req: NextRequest) {
|
|
try {
|
|
const params = await req.json()
|
|
const result = await driftTradingService.executeTrade(params)
|
|
return NextResponse.json(result)
|
|
} catch (e: any) {
|
|
return NextResponse.json({ error: e.message }, { status: 500 })
|
|
}
|
|
}
|
|
|
|
export async function GET() {
|
|
try {
|
|
const positions = await driftTradingService.getPositions()
|
|
return NextResponse.json({ positions })
|
|
} catch (e: any) {
|
|
return NextResponse.json({ error: e.message }, { status: 500 })
|
|
}
|
|
}
|