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.
| Code | Name | Description | Resolution |
|---|---|---|---|
| 0 | Success | The request completed successfully | No action needed |
| 1 | User not found | The specified user account does not exist | Verify your account exists and you are logged in. If you recently created an account, wait a moment and retry |
| 3 | Invalid credentials | The provided authentication token or login credentials are invalid | Log out and log back in to refresh your session token. If using email/password, verify your credentials are correct |
| 9 | Pro required | The requested feature or endpoint requires an active Pro subscription | Upgrade to Pro from Plans & Pricing or check that your subscription has not expired |
| 99 | Internal error | An unexpected server-side error occurred | This 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:
| Status | Meaning | Common scenarios |
|---|---|---|
| 200 | OK | Request succeeded |
| 201 | Created | Resource was created successfully (e.g., new strategy, new battle) |
| 400 | Bad Request | Invalid parameters, malformed request body, or missing required fields |
| 401 | Unauthorized | Authentication token is missing, expired, or invalid |
| 403 | Forbidden | You do not have permission for this action (e.g., Pro-only feature on free tier) |
| 404 | Not Found | The requested resource does not exist (e.g., invalid strategy ID, invalid battle code) |
| 409 | Conflict | A conflicting operation is in progress (e.g., another backtest is already running) |
| 413 | Payload Too Large | The request body exceeds the maximum size (e.g., strategy script over 200 KB) |
| 429 | Too Many Requests | You have exceeded the rate limit. Wait before retrying |
| 500 | Internal Server Error | An unexpected server error occurred. Retry after a brief wait |
| 502 | Bad Gateway | The server is temporarily unavailable, often during deployments |
| 503 | Service Unavailable | The service is down for maintenance or experiencing high load |
| 504 | Gateway Timeout | The 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:
| Code | Name | Description | Resolution |
|---|---|---|---|
| 0 | Success | Operation completed | No action needed |
| 1 | User not found | The simulator user account was not found | Your simulator account may not be provisioned. Try starting a new prop firm simulation from the UI |
| 2 | Session expired | Your simulator session has expired | Refresh the page to create a new session |
| 3 | Invalid credentials | Authentication with the simulator failed | Log out of TestMax and log back in to refresh all tokens |
| 4 | Account not found | The specified trading account does not exist | Select a valid account from the account dropdown, or start a new simulation |
| 5 | Order rejected | The order could not be placed | Check the rejection reason in the response body — common causes include invalid price, invalid quantity, or market closed |
| 6 | Insufficient margin | Not enough margin to place the order | Reduce position size or close existing positions to free up margin |
| 7 | Market closed | The market is not currently in session for the selected date/time | Advance the replay to a time when the market is open, or select a different date |
| 8 | Data unavailable | Historical data is not available for the requested instrument/date | Try a different date or instrument. See Common Issues for details |
| 9 | Pro required | This simulator feature requires a Pro subscription | Upgrade to Pro from Plans & Pricing |
| 10 | Rate limited | Too many API requests in a short period | Wait a few seconds before retrying. If you are running an algo strategy, add a small delay between API calls |
| 99 | Internal error | An unexpected error in the simulator backend | Retry 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 sizeThe format is: [ERROR] API {endpoint}: {HTTP status} {error message}
Common backtest errors:
| Error message | Cause | Fix |
|---|---|---|
Invalid size | Order quantity is 0 or negative | Check your strategy logic for position sizing |
Invalid price | Limit/stop price is 0, negative, or unreasonable | Verify your price calculation logic |
Already running | A previous execution is still active | Wait for it to finish or refresh to trigger cleanup |
Execution timeout | Backtest exceeded the 10-minute limit | Reduce date range or increase timeframe |
Script too large | Strategy code exceeds 200 KB | Reduce 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:
- Note the exact error message and error code
- Record the date, time, instrument, and timeframe you were using
- Copy any relevant output log content
- Contact support via the in-app help button or email
Pro subscribers receive priority support response times.