Skip to content

LevelsAttribute.Levels

property · LevelsAttribute · cAlgo.API

DesktopCLICloud

The array of price values that are ploted as level lines

Definition

public double[] Levels {get; set;}
levelsAttribute.Levels: list[float]

Returns double[]

Examples

public partial class StochasticLevelsSample : Indicator
{
    private StochasticOscillator _stochastic;

    protected override void Initialize()
    {
        _stochastic = Indicators.StochasticOscillator(9, 3, 9, MovingAverageType.Simple);
    }

    public override void Calculate(int index)
    {
        Result[index] = _stochastic.PercentK[index];
    }
}
class StochasticLevelsSample():
    def initialize(self):
        self.stochastic = api.Indicators.StochasticOscillator(9, 3, 9, MovingAverageType.Simple)

    def calculate(self, index):
        api.Result[index] = self.stochastic.PercentK[index]
{
  "AccessRights": "None",
  "IsOverlay": false,
  "LineOutputs": [
    {
      "Name": "Result",
      "DisplayName": "Main"
    }
  ],
  "Levels": [
    20.0,
    50.0,
    80.5
  ]
}