Bollinger bands widen in volatile market periods, and contract during less volatile periods. Tightening of the bands is often used a signal that there will shortly be a sharp increase in market volatility.
//...[Robot]publicclassSampleRobot:Robot//...[Parameter("Source")]publicDataSeriesSource{get;set;}[Parameter("BandPeriods", DefaultValue = 14)]publicintBandPeriod{get;set;}[Parameter("Std", DefaultValue = 14)]publicintstd{get;set;}[Parameter("MAType")]publicMovingAverageTypeMAType{get;set;}//...privateBollingerBandsboll;//...protectedoverridevoidOnStart(){boll=Indicators.BollingerBands(Source,BandPeriod,std,MAType);}protectedoverridevoidOnBar(){Print("Current Main Bollinger Band's price is: {0}",boll.Main.LastValue);Print("Current Bottom Bollinger Band's price is: {0}",boll.Bottom.LastValue);Print("Current Top Bollinger Band's price is: {0}",boll.Top.LastValue);}//...