---
id: "P:cAlgo.API.Plugin.HistoricalOrders"
kind: "property"
type: "T:cAlgo.API.Plugin"
url: "https://help.ctrader.com/ctrader-algo/references/General/Plugin/HistoricalOrders/"
---

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

# Plugin.HistoricalOrders

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

## HistoricalOrders

Provides access to historical orders.

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 HistoricalOrders HistoricalOrders {get;}
```

Python:

```python
api.HistoricalOrders: HistoricalOrders
```

### Returns

`HistoricalOrders` — 

Available since cAlgo.API 5.1.

### Examples

C#:

```csharp
Print("Historical orders: {0}", HistoricalOrders.Count);
var lastOrder = HistoricalOrders.FindLast("MyLabel");
if (lastOrder != null)
    Print("Last order {0} {1} submitted at {2}", lastOrder.Id, lastOrder.SymbolName, lastOrder.SubmittedTime);
```

Python:

```python
api.Print(f"Historical orders: {api.HistoricalOrders.Count}")
lastOrder = api.HistoricalOrders.FindLast("MyLabel")
if lastOrder is not None:
    api.Print(f"Last order {lastOrder.Id} {lastOrder.SymbolName} submitted at {lastOrder.SubmittedTime}")
```

