---
id: "M:cAlgo.API.Plugin.CreateDataSeries(System.String,cAlgo.API.TimeFrame)"
kind: "method"
type: "T:cAlgo.API.Plugin"
url: "https://help.ctrader.com/ctrader-algo/references/General/Plugin/CreateDataSeries/"
---

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

# Plugin.CreateDataSeries

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

## CreateDataSeries(string symbolName, TimeFrame timeFrame)

Returns a new IndicatorDataSeries.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

```csharp
public IndicatorDataSeries CreateDataSeries(string symbolName, TimeFrame timeFrame)
```

Python:

```python
api.CreateDataSeries(symbolName: str, timeFrame: TimeFrame) -> IndicatorDataSeries
```

### Parameters

- `symbolName` (`string`, Python `str`): Symbol name
- `timeFrame` (`TimeFrame`, Python `TimeFrame`): Timeframe

### Returns

`IndicatorDataSeries` — IndicatorDataSeries

Available since cAlgo.API 5.4.

### Examples

C#:

```csharp
var bars = MarketData.GetBars(TimeFrame.Daily, "EURUSD");
var dailyRange = CreateDataSeries("EURUSD", TimeFrame.Daily);
dailyRange[bars.Count - 1] = bars.LastBar.High - bars.LastBar.Low;
Print("Last EURUSD daily range: {0}", dailyRange.LastValue);
```

Python:

```python
bars = api.MarketData.GetBars(TimeFrame.Daily, "EURUSD")
dailyRange = api.CreateDataSeries("EURUSD", TimeFrame.Daily)
dailyRange[bars.Count - 1] = bars.LastBar.High - bars.LastBar.Low
api.Print(f"Last EURUSD daily range: {dailyRange.LastValue}")
```

