The Structure of a Strategy Program

Brief

The section describes the structure of a strategy program written in the SDK.

Details

Each strategy is a small program written in the Lua programming language stored in the separate file. The name of the file must be unique as is used as an identifier of the strategy. The file name extension must be lua.

Each program must provide the following information:

Each program must define the following functions:

Articles

Init()

The strategy profile initialization

Prepare(nameOnly)

The strategy initialization

Update()

The method called every time when a new bid or ask price appears.

ReleaseInstance()

The strategy instance finalization.

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

The notification that an asynchronous operation is finished.

CheckParameters(parameters)

The request to check the parameters before changing the parameters on the fly.

ChangeParameters()

The notification that the parameter set has been changed on the fly.

back