Skip to content

LevelsAttribute constructor

constructor · LevelsAttribute · cAlgo.API

DesktopCLICloud

Initializes a new LevelsAttribute instance

Definition

public LevelsAttribute(double[] levels)
LevelsAttribute(levels: list[float])

Parameters

Name C# type Python type Description
levels double[] list[float] The price values that the level lines are representing

Examples

public partial class MomentumSample : Indicator
{
    public override void Calculate(int index)
    {
        Result[index] = Bars.ClosePrices[index] - Bars.ClosePrices[index - 10];
    }
}
def calculate(self, index):
    api.Result[index] = api.Bars.ClosePrices[index] - api.Bars.ClosePrices[index - 10]
{
  "AccessRights": "None",
  "IsOverlay": false,
  "LineOutputs": [
    {
      "Name": "Result",
      "DisplayName": "Main"
    }
  ],
  "Levels": [
    0
  ]
}