---
id: "M:cAlgo.API.Plugin.OnStart"
kind: "method"
type: "T:cAlgo.API.Plugin"
url: "https://help.ctrader.com/ctrader-algo/references/General/Plugin/OnStart/"
---

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

# Plugin.OnStart

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

## OnStart()

Called when Plugin is being started. Override this method to initialize your Plugin.

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
protected internal void OnStart()
```

Python:

```python
api.OnStart() -> None
```

### Examples

C#:

```csharp
protected override void OnStart()
{
    //This method is invoked when the Plugin is started.
}
```

Python:

```python
def on_start(self):
    # This method is invoked when the Plugin is started.
    pass
```

