Skip to content
Back to App

Error Codes

This page documents the error codes you may encounter when using TestMax. These codes appear in API responses, the output log during backtests, and occasionally in the UI when an operation fails.

TestMax API error codes

These numeric error codes are returned in API responses within the errorCode field.

CodeNameDescriptionResolution
0SuccessThe request completed successfullyNo action needed
1User not foundThe specified user account does not existVerify your account exists and you are logged in. If you recently created an account, wait a moment and retry
3Invalid credentialsThe provided authentication token or login credentials are invalidLog out and log back in to refresh your session token. If using email/password, verify your credentials are correct
9Pro requiredThe requested feature or endpoint requires an active Pro subscriptionUpgrade to Pro from Plans & Pricing or check that your subscription has not expired
99Internal errorAn unexpected server-side error occurredThis is a server issue. Wait a moment and retry. If the error persists, contact support with the full error message

HTTP status codes

In addition to the numeric error codes above, the TestMax API uses standard HTTP status codes:

StatusMeaningCommon scenarios
200OKRequest succeeded
201CreatedResource was created successfully (e.g., new strategy, new battle)
400Bad RequestInvalid parameters, malformed request body, or missing required fields
401UnauthorizedAuthentication token is missing, expired, or invalid
403ForbiddenYou do not have permission for this action (e.g., Pro-only feature on free tier)
404Not FoundThe requested resource does not exist (e.g., invalid strategy ID, invalid battle code)
409ConflictA conflicting operation is in progress (e.g., another backtest is already running)
413Payload Too LargeThe request body exceeds the maximum size (e.g., strategy script over 200 KB)
429Too Many RequestsYou have exceeded the rate limit. Wait before retrying
500Internal Server ErrorAn unexpected server error occurred. Retry after a brief wait
502Bad GatewayThe server is temporarily unavailable, often during deployments
503Service UnavailableThe service is down for maintenance or experiencing high load
504Gateway TimeoutThe request took too long to process. Reduce the scope (e.g., smaller date range) and retry

TopStep Simulator API error codes

When interacting with the TopStep Simulator backend (used for prop firm practice and market replay), you may encounter these additional codes:

CodeNameDescriptionResolution
0SuccessOperation completedNo action needed
1User not foundThe simulator user account was not foundYour simulator account may not be provisioned. Try starting a new prop firm simulation from the UI
2Session expiredYour simulator session has expiredRefresh the page to create a new session
3Invalid credentialsAuthentication with the simulator failedLog out of TestMax and log back in to refresh all tokens
4Account not foundThe specified trading account does not existSelect a valid account from the account dropdown, or start a new simulation
5Order rejectedThe order could not be placedCheck the rejection reason in the response body — common causes include invalid price, invalid quantity, or market closed
6Insufficient marginNot enough margin to place the orderReduce position size or close existing positions to free up margin
7Market closedThe market is not currently in session for the selected date/timeAdvance the replay to a time when the market is open, or select a different date
8Data unavailableHistorical data is not available for the requested instrument/dateTry a different date or instrument. See Common Issues for details
9Pro requiredThis simulator feature requires a Pro subscriptionUpgrade to Pro from Plans & Pricing
10Rate limitedToo many API requests in a short periodWait a few seconds before retrying. If you are running an algo strategy, add a small delay between API calls
99Internal errorAn unexpected error in the simulator backendRetry after a brief wait. If persistent, contact support

Common error patterns

Error during backtest execution

If you see errors in the output log during a backtest, they typically follow this format:

[ERROR] API Order/place: 400 Invalid size

The format is: [ERROR] API {endpoint}: {HTTP status} {error message}

Common backtest errors:

Error messageCauseFix
Invalid sizeOrder quantity is 0 or negativeCheck your strategy logic for position sizing
Invalid priceLimit/stop price is 0, negative, or unreasonableVerify your price calculation logic
Already runningA previous execution is still activeWait for it to finish or refresh to trigger cleanup
Execution timeoutBacktest exceeded the 10-minute limitReduce date range or increase timeframe
Script too largeStrategy code exceeds 200 KBReduce script size — see Common Issues

Authentication errors after session expiry

If you receive error code 3 (Invalid credentials) or HTTP 401 unexpectedly during normal use, your session token has likely expired. This happens if:

  • You have been inactive for an extended period
  • Your subscription status changed
  • You logged in from another device

Solution: Refresh the page or log out and log back in. Your trading data and settings are preserved.

Concurrent execution errors

Error code 409 (Conflict) or the “Already running” message indicates you are trying to start a second concurrent execution. TestMax enforces a limit of one active backtest or replay per user.

Solution: Stop the existing execution first, or wait for it to complete. If you believe no execution is running, wait 30 seconds for the stale process auto-cleanup, then try again.

Reporting errors

If you encounter an error that is not documented here or that persists after following the recommended resolution:

  1. Note the exact error message and error code
  2. Record the date, time, instrument, and timeframe you were using
  3. Copy any relevant output log content
  4. Contact support via the in-app help button or email

Pro subscribers receive priority support response times.