---
id: "M:cAlgo.API.ChartTemplates.Get(System.String)"
kind: "method"
type: "T:cAlgo.API.ChartTemplates"
url: "https://help.ctrader.com/ctrader-algo/references/Chart/Templates/ChartTemplates/Get/"
---

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

# ChartTemplates.Get

Member of [ChartTemplates](https://help.ctrader.com/ctrader-algo/references/Chart/Templates/ChartTemplates/index.md).

## Get(string chartTemplateName)

Returns a chart template by name if exists otherwise null.

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

- CLI: No templates are listed; Create works for this run only and is not saved; Remove returns false; DefaultTemplate throws NullReferenceException.
- Cloud: Empty: Get returns null, Contains and Remove return false, Create and Duplicate throw, DefaultTemplate throws NullReferenceException.

C#:

```csharp
ChartTemplate Get(string chartTemplateName)
```

Python:

```python
api.ChartTemplates.Get(chartTemplateName: str) -> ChartTemplate | None
```

### Parameters

- `chartTemplateName` (`string`, Python `str`): Chart template name

### Returns

`ChartTemplate` — ChartTemplate if found otherwise null.

Available since cAlgo.API 5.6.

### Examples

C#:

```csharp
var template = ChartTemplates.Get("My Template");
if (template == null)
    Print("Template not found");
else
    template.Apply(Chart);
```

Python:

```python
template = api.ChartTemplates.Get("My Template")
if template is None:
    api.Print("Template not found")
else:
    template.Apply(api.Chart)
```

