Skip to content

StandardIndicator.AddToChart

method · StandardIndicator · cAlgo.API

DesktopCLICloud

Adds current indicator to chart if not added yet.

Definition

ChartIndicator AddToChart()
standardIndicator.AddToChart() -> ChartIndicator

Returns ChartIndicator — Chart Indicator

Examples

var sma = Indicators.SimpleMovingAverage(Bars.ClosePrices, 20);
var chartIndicator = sma.AddToChart();
if (chartIndicator != null)
    Print("Added {0} to the chart", chartIndicator.Name);
sma = api.Indicators.SimpleMovingAverage(api.Bars.ClosePrices, 20)
chartIndicator = sma.AddToChart()
if chartIndicator is not None:
    api.Print(f"Added {chartIndicator.Name} to the chart")