资源加载中... loading...

onerror()

The execution of function onerror() will be triggered when an exception occurs. This function does not support strategies written inPython and C++. The onerror() function can take a msg parameter, which is the error message that is reported when the exception is triggered.

function main() {
    var arr = []
    Log(arr[6].Close)  // A program exception is intentionally raised here.
}

function onerror(msg) {
    Log("error:", msg)
}
# not supported by python
// not supported by C++
init() Strategy Framework and API Functions