NinjaScript > Language Reference > Strategy >

Add()

Print this Topic Previous pageReturn to chapter overviewNext page

Definition

Adds an indicator to the strategy only for the purpose of displaying it on a chart.

 

Syntax
Add(Indicator indicator)

 

NOTE: To add Bars objects to your strategy see this article.

 

Parameters

indicator

An indicator object

 

 

Examples

protected override void Initialize()
{
    // Charts a 20 period simple moving average to the chart
    Add(SMA(20));
}