Skip to content

Plugin.Commands

property · Plugin · cAlgo.API

DesktopCLICloud

Provides access to commands.

Environment behaviour

CLI — not supported. Plugins cannot run in the CLI: ctrader-cli runs cBots only.

Cloud — not supported. Plugins cannot run in the cloud: it runs cBots only.

Definition

public Commands Commands {get;}
api.Commands: Commands

Returns Commands

Examples

var command = Commands.Add(CommandType.ChartContainerToolbar, args => Print("Command {0} executed", args.Command.Id));
command.ToolTip = "Run my plugin command";
from System import Action
command = api.Commands.Add(CommandType.ChartContainerToolbar, Action[CommandArgs](lambda args: api.Print(f"Command {args.Command.Id} executed")))
command.ToolTip = "Run my plugin command"