Introduction
cTrader Algo is an all-in-one solution that gives users the opportunity to use various automated trading tools including custom indicators, cBots and plugins.
Note
New cBots, indicators and plugins can be developed in the cTrader Windows and Mac applications.
Defining cBots¶
Think of cBots as programs that run inside cTrader and autonomously execute and manage trading operations. cBots can be designed to perform almost any trading activity such as modifying existing positions or placing pending orders depending on certain conditions.
Defining Custom Indicators¶
A custom indicator is another type of extension that you can develop yourself and/or procure from other developers. Custom indicators can be used to run calculations on cTrader charts using price data, chart drawings, account properties and more.
Indicators can display the results of these calculations on the charts to which they are attached, in separate tabs, or using whatever custom method of output you could design using the features provided by the API.
Defining Plugins¶
A plugin is an algorithm that allows you to integrate cTrader with various third-party services or provide custom means for using first-party cTrader services. In contrast to cBots and custom indicators, plugins are not attached to charts. Instead, they have to be displayed in certain pre-defined areas of the cTrader UI.
Note
You can install and use plugins only in cTrader Windows and Mac.
How to Start Developing a cTrader Algorithm¶
To develop a custom indicator or a cBot, you need to use the C# programming language and the .NET platform.
A basic understanding of both C# and .NET is required for creating indicators, cBots and plugins. This documentation includes the 'C# and .NET Basics' section that contains essential information about both of these tools. However, we also encourage you to search external resources for relevant tutorials and documentation.
Documentation Structure¶
You can read this technical documentation beginning-to-end or simply refer to the section(s) that pose the most interest.
If a code snippet in one section seems unfamiliar or difficult to understand, you can always find more examples in related sections. For example, the 'Creating an Indicator' and 'Indicator Code Samples' articles explain and demonstrate the key principles of how custom indicators work in cTrader Algo.
You can also consult our references library to learn more about the members of this API. If you see an unfamiliar method or a class in a code snippet, there is a high chance that the references library contains its overloads or properties along with a brief description.
The Prerequisites for Working With cTrader Algorithms¶
There are two main prerequisites you have to meet before working with cBots, indicators and plugins.
- Download and install .NET Runtime.
- Download and install the latest version of cTrader, and log in under one of your accounts.
cTrader Windows comes with a built-in compiler that can be used to develop relatively simple robots and indicators. However, you will not be able to use most of the advanced features of cBots/indicators/plugins (such as creating custom UI controls) without switching to the .NET SDK compiler. .NET SDK has to be downloaded and installed separately before you can use it in cTrader Windows.
Note
The .NET SDK already includes .NET Runtime. There is no need to download and install both at the same time.
cTrader Algo includes a built-in code editor that fully supports IntelliSense (a code 'advisor' that can be used for auto-completing expressions and statements). However, you may also choose to develop indicators and cBots via a third-party IDE such as Visual Studio Code. This documentation contains detailed information on using the embedded code editor and external IDEs.