Creating a strategy

In order to create a strategy, you have to go through the following steps:

 

Writing a script

 

You can open and edit an existing script (File => Open ( ribbonactfx05 )), or create a new one (File => New ( ribbonactfx06 )).

The script you are writing needs to be saved on your hard disk. In order to do this use File => Open ( ribbonactfx05 ) or it will be automatically provided to you when you try to compile a script.

We strongly recommend that you do not save your strategies in the application folder.

 

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 ( ribbonactfx03 ) on the Strategy Editor Toolbar or

 - selecting Tools => Compile Current ( ribbonactfx04 ) 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 *.actsc, and use it in the same way as a file with the extension *.acts,

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 *.actsc by selecting File => Save As Compiled.

 

Adding the strategy to the Indicators and Strategies window

 

In order to use your strategy, you have to add it to the Indicators and Strategies window. This window contains the list of all strategies ready for backtesting or execution/running.

This can be done by:

 - clicking the 'Compile and Add/Update' button ( ribbonactfx01 ) on the Strategy Editor Toolbar or

 - selecting Tools => Compile and Add/Update ( ribbonactfx02 ) or

 - pressing Ctrl + F9 combination on the keyboard.

If the strategy is already present in the Indicators and Strategies window, it will be automatically updated.

 

After that you will be able to see your strategy in the MyApps tab of the 'Indicators and Strategies' window.

 

To open the Indicators and Strategies window,  go to:

- Tools -> Indicators and Strategies or

- press the 'Indicators and Strategies' button ( ribbonactfx07 ) on the Tools Toolbar.

 

Ind&strat

 

You can manage available strategies from the 'Indicators and Strategies' window. You can add a strategy by clicking 'Add Script', delete a strategy by clicking 'Remove Script/Folder',

or open the script for viewing or editing by clicking 'Edit Script'.

You can make changes in any of the existing custom 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.