It is possible to add any custom indicators you create to your local Automate reference library. All sample indicators available upon the first launch of cTrader Automate also constitute custom indicators.
Follow these steps to reference a custom indicator.
- Click on the 'Manage References' button in the topmost bar of the Automate UI.
- In the 'Indicators' section of the 'Reference Manager' window, select the required indicators and click 'Apply'. Use the search bar to find the required indicators.
Referenced custom indicators are defined in the
Initialize() method similarly to nested indicators; however, the syntax is slightly different.
Specifically, the name of a custom indicator should be enclosed in angle brackets following the
GetIndicator() directive. Analogously to nested indicators, the parameters of referenced indicators should be enclosed in parentheses as shown in the below snippets.
GetIndicator() directive can be integrated into an indicator as follows.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Alternatively, you can reference the indicator project file from your cTrader indicator/cBot project file.
1 2 3 4 5 6 7 8 9 10 11 12
However, the recommended approach is to use the 'Reference Manager' window.