---
id: "M:cAlgo.API.Internals.IIndicatorsAccessor.Alligator(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,cAlgo.API.MovingAverageType)"
kind: "method"
type: "T:cAlgo.API.Internals.IIndicatorsAccessor"
url: "https://help.ctrader.com/ctrader-algo/references/Indicators/IIndicatorsAccessor/Alligator/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# IIndicatorsAccessor.Alligator

Member of [IIndicatorsAccessor](https://help.ctrader.com/ctrader-algo/references/Indicators/IIndicatorsAccessor/index.md).

## Alligator(int jawsPeriods, int jawsShift, int teethPeriods, int teethShift, int lipsPeriods, int lipsShift, MovingAverageType maType)

Legendary trader Bill Williams, an early pioneer of market psychology, developed the trend-following Alligator indicator, which follows the premise that financial markets and individual securities trend just 15% to 30% of the time while grinding through sideways ranges the other 70% to 85% of the time.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
Alligator Alligator(int jawsPeriods, int jawsShift, int teethPeriods, int teethShift, int lipsPeriods, int lipsShift, MovingAverageType maType)
```

Python:

```python
api.Indicators.Alligator(jawsPeriods: int, jawsShift: int, teethPeriods: int, teethShift: int, lipsPeriods: int, lipsShift: int, maType: MovingAverageType) -> Alligator
```

### Parameters

- `jawsPeriods` (`int`, Python `int`): The jaws period of Alligator
- `jawsShift` (`int`, Python `int`): The jaws shift of Alligator
- `teethPeriods` (`int`, Python `int`): The teeth period of Alligator
- `teethShift` (`int`, Python `int`): The teeth shift of Alligator
- `lipsPeriods` (`int`, Python `int`): The lips period of Alligator
- `lipsShift` (`int`, Python `int`): The lips shift of Alligator
- `maType` (`MovingAverageType`, Python `MovingAverageType`): Moving Average Type

### Returns

`Alligator` — Alligator

### Examples

C#:

```csharp
var alligator = Indicators.Alligator(13, 8, 8, 5, 5, 3, MovingAverageType.Simple);
Print("Jaws: {0}, Teeth: {1}, Lips: {2}", alligator.Jaws.LastValue, alligator.Teeth.LastValue, alligator.Lips.LastValue);
```

Python:

```python
alligator = api.Indicators.Alligator(13, 8, 8, 5, 5, 3, MovingAverageType.Simple)
api.Print(f"Jaws: {alligator.Jaws.LastValue}, Teeth: {alligator.Teeth.LastValue}, Lips: {alligator.Lips.LastValue}")
```

## Alligator(DataSeries source, int jawsPeriods, int jawsShift, int teethPeriods, int teethShift, int lipsPeriods, int lipsShift, MovingAverageType maType)

Legendary trader Bill Williams, an early pioneer of market psychology, developed the trend-following Alligator indicator, which follows the premise that financial markets and individual securities trend just 15% to 30% of the time while grinding through sideways ranges the other 70% to 85% of the time.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
Alligator Alligator(DataSeries source, int jawsPeriods, int jawsShift, int teethPeriods, int teethShift, int lipsPeriods, int lipsShift, MovingAverageType maType)
```

Python:

```python
api.Indicators.Alligator(source: DataSeries, jawsPeriods: int, jawsShift: int, teethPeriods: int, teethShift: int, lipsPeriods: int, lipsShift: int, maType: MovingAverageType) -> Alligator
```

### Parameters

- `source` (`DataSeries`, Python `DataSeries`): The source data used for the Alligator calculation.
- `jawsPeriods` (`int`, Python `int`): The jaws period of Alligator
- `jawsShift` (`int`, Python `int`): The jaws shift of Alligator
- `teethPeriods` (`int`, Python `int`): The teeth period of Alligator
- `teethShift` (`int`, Python `int`): The teeth shift of Alligator
- `lipsPeriods` (`int`, Python `int`): The lips period of Alligator
- `lipsShift` (`int`, Python `int`): The lips shift of Alligator
- `maType` (`MovingAverageType`, Python `MovingAverageType`): Moving Average Type

### Returns

`Alligator` — Alligator

### Examples

C#:

```csharp
var alligator = Indicators.Alligator(Bars.ClosePrices, 13, 8, 8, 5, 5, 3, MovingAverageType.Simple);
var isUpTrend = alligator.Lips.LastValue > alligator.Teeth.LastValue && alligator.Teeth.LastValue > alligator.Jaws.LastValue;
Print("Alligator on close prices, up trend: {0}", isUpTrend);
```

Python:

```python
alligator = api.Indicators.Alligator(api.Bars.ClosePrices, 13, 8, 8, 5, 5, 3, MovingAverageType.Simple)
isUpTrend = alligator.Lips.LastValue > alligator.Teeth.LastValue and alligator.Teeth.LastValue > alligator.Jaws.LastValue
api.Print(f"Alligator on close prices, up trend: {isUpTrend}")
```

