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

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

# Robot.LastResult

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

## LastResult

The latest trade result

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public TradeResult LastResult {get;}
```

Python:

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

### Returns

`TradeResult` — 

### Examples

C#:

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

Python:

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

