---
id: "P:cAlgo.API.ActiveFrameChangedEventArgs.OldFrame"
kind: "property"
type: "T:cAlgo.API.ActiveFrameChangedEventArgs"
url: "https://help.ctrader.com/ctrader-algo/references/EventArgs/ActiveFrameChangedEventArgs/OldFrame/"
---

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

# ActiveFrameChangedEventArgs.OldFrame

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

## OldFrame

Returns the old / previous active frame or null.

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
public Frame OldFrame {get;}
```

Python:

```python
activeFrameChangedEventArgs.OldFrame: Frame
```

### Returns

`Frame` — 

### Examples

C#:

```csharp
protected override void OnStart()
{
    ChartManager.ActiveFrameChanged += OnActiveFrameChanged;
}

private void OnActiveFrameChanged(ActiveFrameChangedEventArgs args)
{
    if (args.OldFrame != null)
        Print("Previous active frame: {0}, index: {1}", args.OldFrame.Id, args.OldFrame.Index);
}
```

Python:

```python
def on_start(self):
    api.ChartManager.ActiveFrameChanged += self.on_active_frame_changed

def on_active_frame_changed(self, args):
    if args.OldFrame is not None:
        api.Print(f"Previous active frame: {args.OldFrame.Id}, index: {args.OldFrame.Index}")
```

