Click or drag to resize

Step2. Create inherited class

Create inherited class

Then you need to choose what will be indicator’s value. There are two major options. It must be double[] if indicator has single return value (for example, like in moving averages) else it must be Slice[] with all indicators value (for example, like Low and High lines in band indicators). If you chose single value, your indicator should be inherited using double like generic parameter:

C#
1public class MyMovingAverage: BaseSimpleIndicator<double>
2{
3}

Else you need to specify custom Slice struct:

C#
1public class MyBandIndicator : BaseBarIndicator<MyBandIndicator.Slice>
2{
3    public struct Slice
4    {
5        public double LowLine;
6        public double HighLine;
7    }
8}