diff --git a/app/api/trade/route.ts b/app/api/trade/route.ts index c7789e8..c4e7d11 100644 --- a/app/api/trade/route.ts +++ b/app/api/trade/route.ts @@ -11,14 +11,14 @@ export async function POST(req: NextRequest) { return NextResponse.json({ error: 'Missing required fields: action, symbol' }, { status: 400 }); } - if (!POINT_VALUES[symbol]) { + if (symbol !== 'Random' && !POINT_VALUES[symbol]) { return NextResponse.json({ error: `Unknown symbol: ${symbol}` }, { status: 400 }); } // Execute trade immediately for all eligible accounts const results = await runTrade(action, symbol); - // (Re)start the 60-second scheduler with this action + symbol + // (Re)start the scheduler with this action + symbol startScheduler(action, symbol); return NextResponse.json(results);