VIDYA: IndicatorDescriptor = ...

Variable Index Dynamic Average: an exponential average whose weight each bar is scaled by how one-sided the recent movement was, so it follows a trend and stands still in a range.

k = |CMO(source, cmoLength)| / 100 vidya = alpha * k * source + (1 - alpha * k) * vidya[1], alpha = 2 / (length + 1)

The seed is pinned: the line opens on the source itself at bar cmoLength, the first bar with cmoLength changes behind it, because there is no prior average to carry and starting from zero would drag the line up from the floor of the chart. A window that did not move reads k = 0 and holds the line, and a bar whose window holds a missing value is absent, with the line resuming afterwards from the value it held.