TA.Alligator
Calculates the Alligator indicator.
TA.Alligator(inPriceHL)
TA.Alligator(inPriceHL, jawLength, teethLength, lipsLength)Examples
Compute the jaw, teeth and lips lines of the Alligator with default parameters.
javascript
function main() {
var records = exchange.GetRecords()
if (!records) return
var alligator = TA.Alligator(records)
Log("jawLine:", alligator[0])
Log("teethLine:", alligator[1])
Log("lipsLine:", alligator[2])
// Output: three arrays that are 8, 5 and 3 elements longer than the K-lines (padded with NaN at
// the start)
}
python
def main():
records = exchange.GetRecords()
if not records:
return
alligator = TA.Alligator(records)
Log("jawLine:", alligator[0])
Log("teethLine:", alligator[1])
Log("lipsLine:", alligator[2])
# Output: three lists that are 8, 5 and 3 elements longer than the K-lines (padded with None at
# the start)
rust
fn main() {
let Ok(records) = exchange.GetRecords(None, None, None) else { return };
let alligator = TA.Alligator(&records, None, None, None);
Log!("jawLine:", alligator[0]);
Log!("teethLine:", alligator[1]);
Log!("lipsLine:", alligator[2]);
// Output: three arrays that are 8, 5 and 3 elements longer than the K-lines (padded with NaN at
// the start)
}Returns
| Type | Description |
array | The return value of the |
Arguments
| Name | Type | Required | Description |
inPriceHL |
| Yes | K-line data (the median of the high and low prices is used). Only K-line data is accepted. |
jawLength | number | No | Period of the Jaw line. |
teethLength | number | No | Period of the Teeth line. |
lipsLength | number | No | Period of the Lips line. |
See Also
Remarks
The default values of the jawLength, teethLength, and lipsLength parameters of the TA.Alligator() function are: 13, 8, and 5 respectively.