Skip to content

Introduction

Defining Plugins

Think of plugins as special algos whose main purpose is to give users easy access to various services. These services typically include the following.

  • First-party cTrader services. This definition covers most major cTrader features including trading, accessing market data, being able to work with local storage, having access to the Internet, etc.
  • Third-party services. This category includes nearly every third-party service you can think of. For example, using the WebView functionality, you can create a plugin that allows other traders to watch Bloomberg TV or other financial news outlets.

With plugins, the possibilities are endless. Here are just some ideas you can use to get started with plugins.

  • An additional trading panel with custom controls
  • A solution allowing traders to use generative AI tools without leaving cTrader
  • A WebView of a powerful financial resource
  • A panel hosting additional analytics about a specific symbol or the trader's account
  • A calculator enabling traders to analyse complex data in one click

How Plugins Work

Plugins have a significant distinction compared to cBots and custom indicators: a plugin can only ever have one active instance. If a plugin is enabled, this instance is running; if a plugin is disabled, the instance is stopped. It is not possible to create any additional instances apart from the currently active singleton.

Tip

You can always see the number of currently running plugins as a green badge displayed in the upper-left corner of the cTrader UI in the icon row just above the app selector. Upon clicking on the plugin icon, you will be taken to the general settings window where you will be able to enable/disable plugins at will.

A plugin can add functional elements to several areas of the cTrader UI and react to user interaction with these blocks. Here are all the UI areas to which a plugin can add something new.

  • The 'Active Symbol Panel' (ASP)
  • The 'Trade Watch' display
  • A custom frame added to the charts display

Alternatively, a plugin could simply use a detached window (or several) to display information.

Consult this tutorial to learn more about showing custom elements via plugins.

Note

A plugin can display information and/or controls in several areas of the cTrader UI, not just one. For example, a plugin can add two buttons to two different custom blocks contained within the ASP.

Note

Unlike cBots and indicators, plugins do not support the [Parameter] attribute for their properties. However, you can still create custom controls to manage plugin parameters. To learn how to do so, click here.

Trading via Plugins

All plugins have access to trading methods (e.g., ExecuteMarketOrder()) and other trading-related API members. However, by design, a plugin needs to have explicit permission from the user to execute trading operations.

This permission can be given (or denied) via the following message box.

This message box appears during the first time a plugin (any plugin) tries to execute a trading operation. Upon the user allowing the plugin to trade, the algo will execute the requested trade. If trading permissions are not given, the plugin will keep running; however, no trading will be performed.

Alternatively, when developing a plugin, you can call the Permissions.TradingPemission.Request() method to define exactly when the message box is displayed to plugin users.

Use Case

You can call the Permissions.TradingPemission.Request() method on plugin start (via the OnStart() handler) so that your plugin can build initial trust among the user base by being open about its capabilities.

Additional Actions With Plugins

Depending on its class attributes, it is possible to detach any of the custom blocks added by a plugin to the cTrader UI. In this case, a plugin will display all its custom controls and information in a separate resizable window. This also allows for displaying custom elements and cTrader in separate monitors in a multi-monitor setup.

Closing the Detached Window

When a detached window is closed by the user, all custom elements will automatically return to their original positions in the cTrader UI.