General Script Structure

A user strategy is a script consisting of a number of procedures. Some of the procedures are triggered by certain events occurring in the system,

while others can be called manually by the user.

Saved strategy script files have a *.acts extension. The strategy script has the following general structure:

 

const

 StrategyName = 'The Name of Your Strategy';

 StrategyVersion = '1.0'; {used to synchronize with FxApps}

 

var

{There global variables are declared here}

 

procedure OnCreate;

begin

{This procedure runs when the strategy window is opened (when you click 'Run')}

end;

 

procedure OnStart;

begin

{This procedure runs when the strategy is started}

end;

 

procedure OnOrderChange(const Action: TDataModificationType; const Order: TOrder);

begin

 {This procedure runs every time when an order is created, executed/removed or modified}

end;

 

procedure OnTradeChange(const Action: TDataModificationType; const Trade: TTrade);

begin

{This procedure runs when a position is opened, closed or modified}

end;

 

procedure OnAccountChange(const Action: TDataModificationType; const Account: TAccount);

begin

{This procedure runs when the following occurs in any of the trader's accounts: balance change, group account changes, default amount change, markups adjustment}

end;

 

procedure OnCommand(const Command: String);

begin

{This procedure runs when you send a command using 'Command' button}

end;

 

Note: All procedures in strategy are optional.