Skip to content

CloudAttribute

class cAlgo.API

DesktopCLICloud

Represents the cloud between the indicator lines.

Definition

public class CloudAttribute : Attribute

Namespace: cAlgo.API · Group: Attributes

Examples

using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo
{
    // This indicator fills the area between two outputs with the Clouds entry of config.json
    public partial class BollingerBandsCloudSample : Indicator
    {
        private BollingerBands _bollingerBands;

        protected override void Initialize()
        {
            _bollingerBands = Indicators.BollingerBands(Bars.ClosePrices, Periods, 2, MovingAverageType.Simple);
        }

        public override void Calculate(int index)
        {
            Top[index] = _bollingerBands.Top[index];
            Bottom[index] = _bollingerBands.Bottom[index];
        }
    }
}
class BollingerBandsCloudSample():
    def initialize(self):
        self.bollingerBands = api.Indicators.BollingerBands(api.Bars.ClosePrices, api.Periods, 2, MovingAverageType.Simple)

    def calculate(self, index):
        api.Top[index] = self.bollingerBands.Top[index]
        api.Bottom[index] = self.bollingerBands.Bottom[index]
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true,
  "Parameters": [
    {
      "Name": "Periods",
      "Type": "Integer",
      "DefaultValue": 20,
      "MinValue": 2
    }
  ],
  "LineOutputs": [
    {
      "Name": "Top",
      "Color": "Red"
    },
    {
      "Name": "Bottom",
      "Color": "Red"
    }
  ],
  "Clouds": [
    {
      "FirstLineName": "Top",
      "SecondLineName": "Bottom",
      "Opacity": 0.2
    }
  ]
}

Constructors

Name Description
CloudAttributeDesktopCLICloud The cloud between the indicator lines.

Properties

Name Description
FirstColorDesktopCLICloudstring Cloud color when the first line is above the second one. If not specified, the color of the first line is used.
FirstLineNameDesktopCLICloudstring The name of the first indicator line.
OpacityDesktopCLIClouddouble The cloud opacity. Value can be set from 0 (transparent) to 1 (opaque). Values higher than 1 will be set to 1, values below 0 will be set to 0. Opacity is multiplied by the alpha channel of the active color (first or second color). Default opacity value is 0.2.
SecondColorDesktopCLICloudstring Cloud color when the second line is above the first one. If not specified, color of the second line is used.
SecondLineNameDesktopCLICloudstring The name of the second indicator line.