Skip to content

Command

interface cAlgo.API

DesktopCLICloud

Represents a plugin command.

Environment behaviour

CLI — not supported. Available to plugins only, and plugins cannot run in the CLI.

Cloud — not supported. Available to plugins only, and plugins cannot run in the cloud.

Definition

public interface Command

Namespace: cAlgo.API · Group: Commands

Examples

var command = Commands.Add(CommandType.ChartContainerToolbar, args => Print("Command executed"));
command.ToolTip = "My plugin command";
command.IsEnabled = Account.Balance > 0;
Print("Command {0} of type {1} added", command.Id, command.Type);
from System import Action
command = api.Commands.Add(CommandType.ChartContainerToolbar, Action[CommandArgs](lambda args: api.Print("Command executed")))
command.ToolTip = "My plugin command"
command.IsEnabled = api.Account.Balance > 0
api.Print(f"Command {command.Id} of type {command.Type} added")

Properties

Name Description
IdDesktopCLICloudGuid Gets command unique Id.
IsEnabledDesktopCLICloudbool Gets / sets if command is enabled or not.
ToolTipDesktopCLICloudstring Gets / sets command tooltips.
TypeDesktopCLICloudCommandType Gets command type.

See also