Fix 400 error when starting scheduler with Random symbol
Skip POINT_VALUES validation for 'Random' — the symbol is resolved to a real instrument inside runTrade before any point value lookup. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
245a15666e
commit
b7952a83ef
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user