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

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

# IIndicatorsAccessor.SwingIndex

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

## SwingIndex(int limitMoveValue)

Returns the Swing Index indicator instance.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
SwingIndex SwingIndex(int limitMoveValue)
```

Python:

```python
api.Indicators.SwingIndex(limitMoveValue: int) -> SwingIndex
```

### Parameters

- `limitMoveValue` (`int`, Python `int`): The value of the limit move used for calculation.

### Returns

`SwingIndex` — Swing Index indicator instance

### Examples

C#:

```csharp
var swingIndex = Indicators.SwingIndex(12);
Print("Swing Index of the last closed bar: {0}", swingIndex.Result.Last(1));
```

Python:

```python
swingIndex = api.Indicators.SwingIndex(12)
api.Print(f"Swing Index of the last closed bar: {swingIndex.Result.Last(1)}")
```

## SwingIndex(Bars bars, int limitMoveValue)

Returns the Swing Index indicator instance.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
SwingIndex SwingIndex(Bars bars, int limitMoveValue)
```

Python:

```python
api.Indicators.SwingIndex(bars: Bars, limitMoveValue: int) -> SwingIndex
```

### Parameters

- `bars` (`Bars`, Python `Bars`): The Bars that will be used by indicator, you can pass another timeframe/symbol bars
- `limitMoveValue` (`int`, Python `int`): The value of the limit move used for calculation.

### Returns

`SwingIndex` — Swing Index indicator instance

### Examples

C#:

```csharp
var dailyBars = MarketData.GetBars(TimeFrame.Daily);
var dailySwingIndex = Indicators.SwingIndex(dailyBars, 12);
Print("Daily Swing Index: {0}", dailySwingIndex.Result.Last(1));
```

Python:

```python
dailyBars = api.MarketData.GetBars(TimeFrame.Daily)
dailySwingIndex = api.Indicators.SwingIndex(dailyBars, 12)
api.Print(f"Daily Swing Index: {dailySwingIndex.Result.Last(1)}")
```

