Skip to content

ChartIndicators.Remove

method · ChartIndicators · cAlgo.API

DesktopCLICloud

Removes an indicator from a chart.

Environment behaviour

Cloud — not supported. Always empty: Count is 0, Add returns null, Remove returns false, and the events never fire.

Definition

bool Remove(ChartIndicator indicator)
api.ChartIndicators.Remove(indicator: ChartIndicator) -> bool

Parameters

Name C# type Python type Description
indicator ChartIndicator ChartIndicator The ChartIndicator to be removed from a chart.

Returns bool — True if remove was successful otherwise false.

Examples

var sma = ChartIndicators.Add("Simple Moving Average", Bars.ClosePrices, 20);
var isRemoved = ChartIndicators.Remove(sma);
Print("Indicator removed: {0}", isRemoved);
sma = api.ChartIndicators.Add("Simple Moving Average", api.Bars.ClosePrices, 20)
isRemoved = api.ChartIndicators.Remove(sma)
api.Print(f"Indicator removed: {isRemoved}")