Appearance
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
| Input | Type | Default |
|---|---|---|
| Jaw length | int | 13 |
| Teeth length | int | 8 |
| Lips length | int | 5 |
| Jaw offset | int | 8 |
| Teeth offset | int | 5 |
| Lips offset | int | 3 |
| Jaw color | color | "#2962FF" |
| Teeth color | color | "#E91E63" |
| Lips color | color | "#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" }) });