//@function Calculates Williams Alligator indicator using SMMA (RMA)
//@param source Series to calculate Alligator from
//@param jawPeriod Period for Jaw line (typically 13)
//@param jawOffset Forward offset for Jaw line (typically 8)
//@param teethPeriod Period for Teeth line (typically 8)
//@param teethOffset Forward offset for Teeth line (typically 5)
//@param lipsPeriod Period for Lips line (typically 5)
//@param lipsOffset Forward offset for Lips line (typically 3)
//@returns Tuple [jaw, teeth, lips] values
//@optimized Uses Wilder's RMA (SMMA) with exponential warmup compensator for O(1) complexity
alligator(series float source, simple int jawPeriod, simple int jawOffset, simple int teethPeriod, simple int teethOffset, simple int lipsPeriod, simple int lipsOffset) =>
if jawPeriod <= 0 or teethPeriod <= 0 or lipsPeriod <= 0
runtime.error("All periods must be greater than 0")
if jawOffset < 0 or teethOffset < 0 or lipsOffset < 0