BollingerBands


Summary

Bollinger Bands are used to confirm signals. The bands indicate overbought and oversold levels relative to a moving average.

Remarks

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.

Syntax

public interface BollingerBands

Members

NameTypeSummary
Bottom PropertyLower Bollinger Band.
Main PropertyMoving Average (Middle Bollinger Band).
Top PropertyUpper Bollinger Band.

Example 1

//...
[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);
    Print("Current Bottom Bollinger Band's price is: {0}", boll.Bottom.LastValue);
    Print("Current Top Bollinger Band's price is: {0}", boll.Top.LastValue);
}
//...