cTrader Algo enables traders to draw clouds between lines on a chart. Such clouds allow you to quickly identify key areas on charts and detect shifts in market behaviour.
In this article and its corresponding video, we will show you how to add and customise clouds in indicators.
A typical Bollinger Bands indicator consists of an upper band, a lower band and a simple moving average in the middle. To enhance the indicator appearance, we plan to fill the space between the bands with a cloud.
First, let's create the indicator. We open the 'Algo' app and navigate to the 'Indicators' tab.
Click the 'New' button, type in a name for the indicator, such as 'Bollinger Bands Cloud', and then click the 'Create' button.
We can now modify the indicator code. Let’s make our example an overlay indicator.
Now, we return to the code editor and then work on adding a cloud between the bands.
To achieve our goal, we add the Cloud attribute to the existing indicator. The Cloud attribute instructs the indicator to draw a cloud between the Top and Bottom lines.
Let’s create a new indicator and use it to demonstrate how clouds with different colours can be added to a chart. We intend to develop a Moving Average (MA) Crossover indicator with a green cloud for uptrends and a red cloud for downtrends.
Repeat the steps from the previous section to create a new indicator. This time, the indicator name should be 'MA Cloud'.
We start modifying the new indicator by setting its IsOverlay property to True.
Repeat the step from the previous example (i.e., Bollinger Bands). Initialise the moving averages and pass the resulting values to the lines so that they are displayed on the chart.
Build the indicator and then add an instance to view the indicator on a chart.
The cloud colours change on each cross (intersection) of the moving averages.
This article showed you how to add useful clouds to indicators in cTrader. To learn more about the cTrader Algo API, see our documentationor post a question on our forum.