IndicatorDataSeries.Item
property · IndicatorDataSeries · cAlgo.API
DesktopCLICloud
Gets or sets the value at the specified index.
Definition
double Item {get; set;}
indicatorDataSeries[index: int] -> float
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
index | int | int |
Returns double
Examples
public partial class BarRange : Indicator
{
public override void Calculate(int index)
{
Result[index] = Bars.HighPrices[index] - Bars.LowPrices[index];
if (index > 0 && Result[index] > Result[index - 1] * 2)
Print("Bar range doubled at index {0}", index);
}
}
def calculate(self, index):
api.Result[index] = api.Bars.HighPrices[index] - api.Bars.LowPrices[index]
if index > 0 and api.Result[index] > api.Result[index - 1] * 2:
api.Print(f"Bar range doubled at index {index}")
{
"AccessRights": "None",
"IsOverlay": false,
"LineOutputs": [
{
"Name": "Result",
"DisplayName": "Main"
}
]
}