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

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

# Plugin.LastResult

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

## LastResult

The latest trade result

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

Python:

```python
api.LastResult: TradeResult
```

### Returns

`TradeResult` — 

### Examples

C#:

```csharp
ExecuteMarketOrder(TradeType.Buy, "EURUSD", 10000, "MyLabel");
if (LastResult.IsSuccessful)
    Print("Position {0} opened at {1}", LastResult.Position.Id, LastResult.Position.EntryPrice);
else
    Print("Order failed: {0}", LastResult.Error);
```

Python:

```python
api.ExecuteMarketOrder(TradeType.Buy, "EURUSD", 10000, "MyLabel")
if api.LastResult.IsSuccessful:
    api.Print(f"Position {api.LastResult.Position.Id} opened at {api.LastResult.Position.EntryPrice}")
else:
    api.Print(f"Order failed: {api.LastResult.Error}")
```

