I am using C# Lists to track things which don't occur on every bar (e.g. ZigZag Highs). Is there a way to use existing indicators on my list values (e.g. convert the list to a series)?
An example of what I am trying to achieve is:
private List<double> ZigZagSwingHighs;
....
else if (State == State.Configure)
{
ZigZagSwingHighs = new List<double>();
}
protected override void OnBarUpdate()
{
if(IsNewSwingHigh())
ZigZagSwingHighs.Insert(0, ZigZagHigh) //The insert here replicates the series behaviour with [0] holding the latest value.
Plot[0] = SMA(ZigZagSwingHighs, 5); // This will fail as it's a list, not a series...
}
Comment