I'm trying to add a daily indicator to a 30 minute chart through a strategy. I searched the forum for help and found a post on adding a plot and then setting Values[0][0] in OnBarUpdate and from that, I can get an SMA to work just fine. The problem is when I try to use the Swing indicator, it no longer works. It prints dots on the chart but they aren't accurate.
Code:
if (State == State.SetDefaults)
{
AddPlot(new Stroke(Brushes.Blue), PlotStyle.Dot, "DAILYSWING");
}
else if (State == State.Configure)
{
AddDataSeries(BarsPeriodType.Second, 15);
AddDataSeries(BarsPeriodType.Day, 1);
}
if (BarsInProgress == 0)
{
Values[0][0] = Low[Math.Max(0, Swing(BarsArray[2], 2).SwingLowBar(0, 1, 1000))];
}
#region Properties
[Browsable(false)]
[XmlIgnore]
public Series<double> DAILYSWING
{
get { return Values[0]; }
}
#endregion
Any idea why? Appreciate any insight.

Comment