Skip to content

RobotAttribute.AddIndicators

property · RobotAttribute · cAlgo.API

DesktopCLICloud

Gets or sets whether indicators created by robot will be added to chart or not.

Definition

public bool AddIndicators {get; set;}
robotAttribute.AddIndicators: bool

Returns bool

Examples

public partial class AddIndicatorsBot : Robot
{
    private SimpleMovingAverage _sma;

    protected override void OnStart()
    {
        _sma = Indicators.SimpleMovingAverage(Bars.ClosePrices, 20);
    }

    protected override void OnBarClosed()
    {
        Print("SMA: {0}", _sma.Result.Last(1));
    }
}
def on_start(self):
    self.sma = api.Indicators.SimpleMovingAverage(api.Bars.ClosePrices, 20)

def on_bar_closed(self):
    api.Print(f"SMA: {self.sma.Result.Last(1)}")
{
  "AccessRights": "None",
  "AddIndicators": true
}