Skip to content

PopupNotification.Complete

method · PopupNotification · cAlgo.API Since 5.3

DesktopCLICloud

Completes an InProgress popup notification.

Environment behaviour

CLI — works differently. Complete only changes the local State; nothing is shown. Still throws InvalidOperationException when the state is not InProgress.

Cloud — works differently. Complete only changes the local State; nothing is shown. Still throws InvalidOperationException when the state is not InProgress.

Definition

void Complete(PopupNotificationState finalState)
popupNotification.Complete(finalState: PopupNotificationState) -> None

Parameters

Name C# type Python type Description
finalState PopupNotificationState PopupNotificationState Final state.

Examples

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);
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)