os.exit
Exit the program.
exit()
exit(status)Examples
Exit program after checking conditions.
javascript
function main() {
if (!os.exists("required_config.json")) {
Log("Required configuration file not found!")
os.exit(1) // Abnormal exit
}
Log("Configuration found, continuing...")
// Normal strategy logic...
}Arguments
| Name | Type | Required | Description |
status | number | No | Optional exit status code, default value is 0. |
See Also
Remarks
Immediately terminates the strategy process without running onexit() or other cleanup functions. Status code 0 indicates a normal finish (the live trading is shown as completed), non-zero values indicate abnormal exit (the live trading is shown as error).