ALLIGATOR: IndicatorDescriptor = ...

Williams Alligator — three Wilder-smoothed medians of differing speed, each displaced forward in time. The lines braid when the market has nothing to say and fan out in order once a trend takes hold.

the reference smma is `na(smma[1]) ? sma(src, length) : (smma[1] * (length - 1)

  • src) / length, which is Wilder's RMA to the letter, so rmareproduces it exactly and first prints atlength - 1`.

Lengths default to 21 / 13 / 8, not to Williams' original 13 / 8 / 5: the reference runs the slower set, and the offsets 8 / 5 / 3 are shared by both, so only the smoothing lengths move. A saved chart that never set them draws three slower lines now.

The three plots carry offset = 8 / 5 / 3. A plot offset is not available per-plot here, so the displacement is applied to the values instead: the value computed on bar i is returned in slot i + offset, which leaves offset leading nulls and puts the shifted tail in the last offset slots. A line therefore first prints at length - 1 + offset.