AsyncOperationFinished(cookie, successful, message, message1, message2)

Brief

The notification that an asynchronous operation is finished.

Details

Unlike the indicators, the function is usually required in the strategy. This function receives notifications of asynchronous execution of "getHistory" calls of the host:execute() methods, which are usually called to get other instruments and/or instruments in the time frame other than "tick", as well as notifications of timers and trading commands.

This function is called when the asynchronous operation, such as the history loading is finished and data are available.

Parameters

Name

Description

cookie

The cookie value passed to the host or terminal method.

success

true if the operation finished successfully or false if the operation has been failed.

message

The string message. In case the operation failed, the message usually contains the error text. In case the operation has been successfully finished, the value depends on the operation. For example, the "getHistory" call of the host returns nil in this field, the executeOrder of the terminal table returns the order identifier.

message1, message2

Additional messages. See particular notifications documentation for details about these parameters.

back