Skip to content

Williams Alligator ​

Three smoothed averages shifted forward: jaw, teeth and lips.

Kind indicator · Drawn on the price pane

Try it ​

On the chart, press / and choose Williams Alligator under Trend. To change it, copy the source below into the AlphaScript editor.

Inputs ​

InputTypeDefault
Jaw lengthint13
Teeth lengthint8
Lips lengthint5
Jaw offsetint8
Teeth offsetint5
Lips offsetint3
Jaw colorcolor"#2962FF"
Teeth colorcolor"#E91E63"
Lips colorcolor"#66BB6A"

Source ​

From packages/alphascript/indicators/alligator.as.js.

js
indicator({ name: "Williams Alligator", shortTitle: "Alligator", overlay: true });
const jawLength = input.int("Jaw length", 13, { min: 1 }), teethLength = input.int("Teeth length", 8, { min: 1 }), lipsLength = input.int("Lips length", 5, { min: 1 });
const jawOffset = input.int("Jaw offset", 8, { min: -500, max: 500 }), teethOffset = input.int("Teeth offset", 5, { min: -500, max: 500 }), lipsOffset = input.int("Lips offset", 3, { min: -500, max: 500 });
const hl2 = ta.calc([candle.high, candle.low], (h, l) => (h + l) / 2);
plot(ta.rma(hl2, jawLength), { title: "Jaw", offset: jawOffset, color: input.color("Jaw color", "#2962FF", { group: "Style" }) });
plot(ta.rma(hl2, teethLength), { title: "Teeth", offset: teethOffset, color: input.color("Teeth color", "#E91E63", { group: "Style" }) });
plot(ta.rma(hl2, lipsLength), { title: "Lips", offset: lipsOffset, color: input.color("Lips color", "#66BB6A", { group: "Style" }) });

AlphaScript language v0.1 · runtime 0.2.0