---
id: "M:cAlgo.API.PopupNotification.Complete(cAlgo.API.PopupNotificationState)"
kind: "method"
type: "T:cAlgo.API.PopupNotification"
url: "https://help.ctrader.com/ctrader-algo/references/Notifications/PopupNotification/Complete/"
---

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

# PopupNotification.Complete

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

## Complete(PopupNotificationState finalState)

Completes an InProgress popup notification.

Environments: Desktop supported · CLI works differently · Cloud works differently.

- CLI: Complete only changes the local State; nothing is shown. Still throws InvalidOperationException when the state is not InProgress.
- Cloud: Complete only changes the local State; nothing is shown. Still throws InvalidOperationException when the state is not InProgress.

C#:

```csharp
void Complete(PopupNotificationState finalState)
```

Python:

```python
popupNotification.Complete(finalState: PopupNotificationState) -> None
```

### Parameters

- `finalState` (`PopupNotificationState`, Python `PopupNotificationState`): Final state.

Available since cAlgo.API 5.3.

### Examples

C#:

```csharp
var popup = Notifications.ShowPopup("Close all", "Closing positions...", PopupNotificationState.InProgress);
foreach (var position in Positions)
    position.Close();
popup.Complete(Positions.Count == 0 ? PopupNotificationState.Success : PopupNotificationState.Partial);
```

Python:

```python
popup = api.Notifications.ShowPopup("Close all", "Closing positions...", PopupNotificationState.InProgress)
for position in list(api.Positions):
    position.Close()
popup.Complete(PopupNotificationState.Success if api.Positions.Count == 0 else PopupNotificationState.Partial)
```

