ActFX is a proprietory scripting language which will help you to realize your trade tactics and write your own strategies. It is based on PASCAL language, although there are some structural differences, and some new functions and procedures.
A user strategy is a script consisting of a number of procedures. Some of the procedures are triggered by certain events occuring in the system, while others can be called manually by the user. Saved script files have the extension *.act. The strategy script has the following general structure:
const StrategyName = 'The Name of Your Strategy';
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; |