UI Basics
Main Menu¶
The 'Local' Tab¶
All locally stored cBots and custom indicators are detailed in their related collapsible lists. By default, the 'Local' tab should contain several sample extensions upon your first interaction with the 'Automate' menu.
Typw something into the search bar beneath the tab switcher, and cTrader will search both the cBots list and the indicators list for anything that matches your search.
To create a cBot or an indicator, click on the 'New cBot/Indicator' button to the right of the search bar. To switch whether this button creates bots or indicators, open the drop-down menu to its right and select the required extension.
Click on the 'three dots' icon to the right of an extension to open a menu containing the following options.
Option Name | Action and Description |
---|---|
Add an Instance | Add a new cBot/indicator instance and edit its parameters. Only the parameters that the extension code defines as editable are available for editing. |
Remove an Instance | Select and remove a cBot/indicator instance. |
Edit in Visual Studio | Open and edit the cBot/indicator in Visual Studio. This option does nothing if Visual Studio is not installed on your desktop. |
Build | Build the cBot/indicator from the current code. |
Build with Source Code | Build the cBot/indicator code file and save the resulting .algo file on your local machine. |
Rename | Rename the cBot/indicator. Keyboard shortcut: F2 |
Delete | Delete the cBot/indicator. |
Duplicate | Duplicate the cBot/indicator. |
Show in Folder | Open the folder containing the cBot/indicator file on your local machine. |
Code Editor¶
By default, the code editor window is located in the center of the screen. You can write, edit, and build your cBots and indicators directly in this editor without using any third-party IDEs.
The bar at the top of the editor contains several buttons and menus.
These options and actions are defined below.
Menu/Button Name | Action and Description |
---|---|
Save | Save all currently unsaved changes to the extension code. Keyboard shortcut: Ctrl+S |
Build | Build an extension using the current code. If there are any unsaved changes, a red '*' sign will be displayed next to this icon. Keyboard shortcut: Ctrl+B. |
Manage References | Open the searchable 'Reference Manager' window. |
Target Framework | The version of the .NET framework that will be used for compiling the extension code. |
The Build Result Window¶
Located directly below the code editor, the 'Build Result' window displays the results of the 'Build' action. If a build succeeds, you should see the following.
If the 'Build' action is unsuccessful, the window will display the below result.
The message should also display all errors encountered when performing the 'Build' action.
API Reference Explorer¶
The right-most column in the UI contains a fully searchable API reference explorer. In the below example, we use the tradetype
query to find the GetEstimatedMargin()
method and learn more about how it works.
The code in the Signature field can be copied to your clipboard. This can be useful when you want to override an existing method or base one of your custom methods on an already existing method signature.