Are there any problems in my code?
protected override void Initialize()
{
Add(PeriodType.Minute, 15);
Add(PeriodType.Minute, 30);
Add(PeriodType.Minute, 60);
Add(new Plot(Color.FromKnownColor(color), PlotStyle.Line, "SMA5"));
Add(new Plot(Color.FromKnownColor(color), PlotStyle.Line, "SMA15"));
Add(new Plot(Color.FromKnownColor(color), PlotStyle.Line, "SMA30"));
Add(new Plot(Color.FromKnownColor(color), PlotStyle.Line, "SMA60"));
CalculateOnBarClose = true;
Overlay = false;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
SMA5.Set(SMA(period)[0]);
SMA15.Set(SMA(BarsArray[1], period)[0]);
SMA30.Set(SMA(BarsArray[2], period)[0]);
SMA60.Set(SMA(BarsArray[3], period)[0]);
}

Comment