In order to create a strategy, you have to go through the following steps:
1) Writing a script
You can open and edit an existing script (File => Open ()), or create a new one (File => New (
)).
We strongly recommend that you do not save your strategies in the application folder.
2) Compiling the script
After you finish writing your code, you need to compile it. This will translate your script into machine code.
This can be done by:
- clicking the 'Compile' button () on the Strategy Editor Toolbar or
- selecting Tools => Compile Current () or
- pressing the F9 button on the keyboard.
If there are no errors, the debugger will show the message “Compiled successfully”. If the script contains any errors, the debugger will indicate them. It will show the type of every error, the line # and the column #, therefore it will be easy to find and correct them.
If you wish, you can also hide the script when compiling your strategy. You can create a file with the extension .actc, and use it in the same way as a file with the extension .act, however it will not be possible to open such a file from the Strategy editor to see or edit the script. This feature allows you to share your strategies without revealing your code.
You can create a file with the extension .actc by selecting File => Save as compiled.
3) Adding the strategy to the Strategy List
In order to use your strategy, you have to add it to the Strategy List. This list contains all strategies ready for backtesting or execution/running.
This can be done by:
- clicking the 'Compile and Add/Update' button () on the Strategy Editor Toolbar or
- selecting Tools -> Compile and Add/Update () or
- pressing Ctrl + F9 combination on the keyboard.
If the strategy is already present in the Strategy List, it will be automatically updated.
To open the Strategy List, go to:
- Main Menu ->ActFX -> Strategy List or
- Tools -> Strategy List or
- press the 'Launch Strategy' button () on the Tools Toolbar.
You can manage available strategies from the ‘Strategy List’ window. You can add a strategy by clicking 'Add', delete a strategy by clicking 'Remove', or open the script for viewing or editing by clicking 'Edit'. You can make changes in any of the existing strategies at any time (these changes will not affect the currently running strategies). From this window you can also Run or Test a strategy in the Strategy Tester.