BollingerBands


Summary

The Bollinger Bands indicator shows volatility.

Syntax

public BollingerBands BollingerBands(DataSeries source, int periods, double standardDeviations, MovingAverageType maType)

Parameters

NameDescription

Example 1

[Parameter]
public DataSeries Source { get; set; }
[Parameter(DefaultValue = 20)]
public int period { get; set; }
[Parameter("MA Type", DefaultValue = MovingAverageType.Simple)]
public MovingAverageType MAType { get; set; }
[Parameter(DefaultValue = 1.5)]
public double std { get; set; }
private BollingerBands bb;
protected override void OnStart()
{
    bb = Indicators.BollingerBands(Source, period, std, MAType);
}
protected override void OnTick()
{
    if (bb.Top.LastValue > Symbol.Bid)
    {
        Print("Bid price is higher than the Top Bollinger Band");
    }
}