protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Name = "DailySMA";
Description = @"Enter the description for your new custom Indicator here.";
IsOverlay = true;
IsSuspendedWhileInactive = true;
Period = 14;
AddPlot(Brushes.Orange, Name);
}
else if (State == State.Configure)
{
AddDataSeries(BarsPeriodType.Day, 1);
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (BarsArray[1].DayCount <= 0)
return;
Print(Time[0] + " " + BarsArray[1].DayCount);
Value[0] = SMA(BarsArray[1], Period)[0];
Comment