IndicatorAttribute.IsPercentage
property · IndicatorAttribute · cAlgo.API
DesktopCLICloud
Gets or sets whether the indicator is a percentage indicator. If one or more percentage indicators are added to the same panel, they will share the same scale. The default value is false.
Definition
public bool IsPercentage {get; set;}
indicatorAttribute.IsPercentage: bool
Returns bool
Examples
public partial class PercentageChangeSample : Indicator
{
public override void Calculate(int index)
{
Result[index] = (Bars.ClosePrices[index] - Bars.OpenPrices[index]) / Bars.OpenPrices[index] * 100;
}
}
def calculate(self, index):
api.Result[index] = (api.Bars.ClosePrices[index] - api.Bars.OpenPrices[index]) / api.Bars.OpenPrices[index] * 100
{
"AccessRights": "None",
"IsOverlay": false,
"IsPercentage": true,
"LineOutputs": [
{
"Name": "Result",
"DisplayName": "Change %"
}
]
}