---
id: "M:cAlgo.API.Internals.IIndicatorsAccessor.WeightedClose"
kind: "method"
type: "T:cAlgo.API.Internals.IIndicatorsAccessor"
url: "https://help.ctrader.com/ctrader-algo/references/Indicators/IIndicatorsAccessor/WeightedClose/"
---

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

# IIndicatorsAccessor.WeightedClose

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

## WeightedClose()

The WeightedClose indicator is an average of each day's price with extra weight given to the closing price.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
WeightedClose WeightedClose()
```

Python:

```python
api.Indicators.WeightedClose() -> WeightedClose
```

### Returns

`WeightedClose` — WeightedClose indicator instance

### Examples

C#:

```csharp
var weightedClose = Indicators.WeightedClose();
Print("Weighted close of the last closed bar: {0}", weightedClose.Result.Last(1));
```

Python:

```python
weightedClose = api.Indicators.WeightedClose()
api.Print(f"Weighted close of the last closed bar: {weightedClose.Result.Last(1)}")
```

## WeightedClose(Bars bars)

The WeightedClose indicator is an average of each day's price with extra weight given to the closing price.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
WeightedClose WeightedClose(Bars bars)
```

Python:

```python
api.Indicators.WeightedClose(bars: Bars) -> WeightedClose
```

### Parameters

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

### Returns

`WeightedClose` — WeightedClose indicator instance

### Examples

C#:

```csharp
var dailyBars = MarketData.GetBars(TimeFrame.Daily);
var dailyWeightedClose = Indicators.WeightedClose(dailyBars);
Print("Weighted close of the last closed daily bar: {0}", dailyWeightedClose.Result.Last(1));
```

Python:

```python
dailyBars = api.MarketData.GetBars(TimeFrame.Daily)
dailyWeightedClose = api.Indicators.WeightedClose(dailyBars)
api.Print(f"Weighted close of the last closed daily bar: {dailyWeightedClose.Result.Last(1)}")
```

