I have inserted those statements at line 175 of the original Swing indicator. So it looks like this
if (saveCurrentBar != CurrentBar)
{
// bunch of code
}
else
{
// update the caches
if (High[0] > (double) lastHighCache[lastHighCache.Count - 1])
lastHighCache[lastHighCache.Count - 1] = High[0];
if (Low[0] < (double) lastLowCache[lastLowCache.Count - 1])
lastLowCache[lastLowCache.Count - 1] = Low[0];
if (High[0] > High[strength] && swingHighSwings[strength] > 0.0)
{
swingHighSwings.Set(strength, 0.0);
for (int i=0; i<=strength; i++)
SwingHighPlot.Reset(i);
currentSwingHigh = 0.0;
}
.... continue with rest of code.....
}
Hope this helps.

Comment