---
id: "E:cAlgo.API.CustomTimeFrame.NewChart"
kind: "event"
type: "T:cAlgo.API.CustomTimeFrame"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/TimeFrame/Custom/CustomTimeFrame/NewChart/"
---

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

# CustomTimeFrame.NewChart

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

## NewChart

Occurs when user opens a new chart of current custom time frame.

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

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

C#:

```csharp
event Action<CustomTimeFrameNewChartEventArgs> NewChart;
```

Python:

```python
customTimeFrame.NewChart += handler  # handler(obj: CustomTimeFrameNewChartEventArgs)
```

### Returns

`Action<CustomTimeFrameNewChartEventArgs>` — 

Available since cAlgo.API 5.3.

### Examples

C#:

```csharp
protected override void OnStart()
{
    var customTimeFrame = TimeFrameManager.Custom.Add("My Custom TF");
    customTimeFrame.NewChart += OnCustomTimeFrameNewChart;
}

private void OnCustomTimeFrameNewChart(CustomTimeFrameNewChartEventArgs args)
{
    Print("New {0} chart opened for {1}", args.CustomTimeFrame.Name, args.CustomBars.Symbol.Name);
}
```

Python:

```python
def on_start(self):
    customTimeFrame = api.TimeFrameManager.Custom.Add("My Custom TF")
    customTimeFrame.NewChart += self.on_custom_time_frame_new_chart

def on_custom_time_frame_new_chart(self, args):
    api.Print(f"New {args.CustomTimeFrame.Name} chart opened for {args.CustomBars.Symbol.Name}")
```

