Skip to content

Main Property

Summary

Moving Average (Middle Bollinger Band).

Signature

1
public abstract IndicatorDataSeries Main {get;}

Return Value

IndicatorDataSeries

Declaring Type

cAlgo.API.Indicators.BollingerBands

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 //...
 [Robot]
 public class SampleRobot : Robot
 //...
 [Parameter("Source")]
 public DataSeries Source { get; set; }
 [Parameter("BandPeriods", DefaultValue = 14)]
 public int BandPeriod { get; set; }
 [Parameter("Std", DefaultValue = 14)]
 public int std { get; set; }
 [Parameter("MAType")]
 public MovingAverageType MAType { get; set; }
 //...
 private BollingerBands boll;
 //...
 protected override void OnStart()
 {
     boll = Indicators.BollingerBands(Source,BandPeriod,std,MAType);
 }
 protected override void OnBar()
 {
     Print("Current Main Bollinger Band's price is: {0}", boll.Main.LastValue);
 }
 //...

Last update: March 23, 2023