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

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

# IIndicatorsAccessor.Fractals

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

## Fractals(int periods)

The fractal indicator is a trading indicator used in technical analysis that is used to identify potential trend reversal points in a market.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
Fractals Fractals(int periods)
```

Python:

```python
api.Indicators.Fractals(periods: int) -> Fractals
```

### Parameters

- `periods` (`int`, Python `int`): Fractals Period

### Returns

`Fractals` — Fractals

### Examples

C#:

```csharp
var fractals = Indicators.Fractals(5);
// A fractal value is NaN on bars without a fractal
if (!double.IsNaN(fractals.UpFractal.Last(3)))
    Print("Up fractal at {0}", fractals.UpFractal.Last(3));
```

Python:

```python
import math
fractals = api.Indicators.Fractals(5)
# A fractal value is NaN on bars without a fractal
if not math.isnan(fractals.UpFractal.Last(3)):
    api.Print(f"Up fractal at {fractals.UpFractal.Last(3)}")
```

## Fractals(Bars bars, int periods)

The fractal indicator is a trading indicator used in technical analysis that is used to identify potential trend reversal points in a market.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
Fractals Fractals(Bars bars, int periods)
```

Python:

```python
api.Indicators.Fractals(bars: Bars, periods: int) -> Fractals
```

### Parameters

- `bars` (`Bars`, Python `Bars`): The Bars that will be used by indicator, you can pass another timeframe/symbol bars
- `periods` (`int`, Python `int`): Fractals Period

### Returns

`Fractals` — Fractals

Available since cAlgo.API 5.2.

### Examples

C#:

```csharp
var dailyBars = MarketData.GetBars(TimeFrame.Daily);
var dailyFractals = Indicators.Fractals(dailyBars, 5);
Print("Daily down fractal three bars ago: {0}", dailyFractals.DownFractal.Last(3));
```

Python:

```python
dailyBars = api.MarketData.GetBars(TimeFrame.Daily)
dailyFractals = api.Indicators.Fractals(dailyBars, 5)
api.Print(f"Daily down fractal three bars ago: {dailyFractals.DownFractal.Last(3)}")
```

