Type/to search
Built-in Functions
Global
Log
Market
Trade
Account
Futures
Exchange
IO
Network
Storage
Threads
TA
TA.MACD
TA.KDJ
TA.RSI
TA.ATR
TA.OBV
TA.MA
TA.EMA
TA.BOLL
TA.Alligator
TA.CMF
TA.Highest
TA.Lowest
TA.SMA
Talib
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

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

TypeDescription

array

The return value of the TA.Alligator() function is a two-dimensional array with the structure: [jawLine, teethLine, lipsLine]. The jaw, teeth and lips lines are shifted right by 8, 5 and 3 bars: 8, 5 and 3 NaN (None in Python) are prepended respectively, so the three arrays are 8, 5 and 3 elements longer than the input.

Arguments

NameTypeRequiredDescription

inPriceHL

Record array

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.