The TradeWatch Tab Sample plugin adds a new tab to Trade Watch, displaying live statistics and trading actions for the symbol in the active chart. It provides the following key functionalities:
Adds the plugin as a new tab in Trade Watch automatically.
Displays live trading statistics.
Enables market order execution for the current chart symbol.
Updates automatically when the active chart symbol changes.
The plugin runs through the dedicated Trade Watch tab, which reflects the active chart. It remains active while cTrader Windows or Mac is running and automatically releases system resources when stopped.
Learn how to create plugins, using either C# or Python, in our step-by-step guides.
TradeWatch Tab Sample plugin code is available in our public C# and Python repositories. The same code is provided as a template in the algorithm creation wizard in cTrader Windows or Mac, or you can simply copy and use the snippet below:
This plugin links the real-time chart context to trade execution through Trade Watch panel. The table below outlines its key components and their functions:
Parameter
Description
Possible values
TradeWatch.AddTab
Tab configuration for the Trade Watch panel.
Active chart symbol stats
StackPanel.Orientation
Defines the stacking direction of UI elements.
Vertical or horizontal
HorizontalAlignment
Defines the horizontal alignment of the panel in the tab.
Center, left, right, etc.
SymbolStatsControl.Margin
Sets margin around the symbol stats control element.
10, 12, 14, etc.
TradeControl.Margin
Sets margin around the trade control element.
10, 12, 14, etc.
SymbolStatsControl.Symbol
Binds the symbol stats control element to a specific chart symbol.
chartframe.symbol, eurusd, gbpjpy, etc.
TradeControl.Symbol
Links TradeControl to a symbol for trade actions.
chartframe.symbol, eurusd, gbpjpy, etc.
ChartManager.ActiveFrameChanged
Event that triggers symbol stat updates when chart frame changes.
_ => setsymbolstats()
TradeControl.Trade
Event triggered when a trade action is taken from the control panel.
The TradeWatch Tab Sample plugin provides a straightforward way to enhance cTrader by linking real-time chart context with trade execution. It supports practical applications that streamline trading workflows. Below are practical use cases that demonstrate how the plugin can enhance the trading experience.
Use case
Scenario
Value
Symbol lock
Set the plugin tab to always display a fixed symbol like EURUSD instead of updating with each chart switch.
Helps you track and trade one instrument consistently, regardless of chart context.
Chart-linked trading panel
Keep the plugin synced with the active chart symbol to always show relevant stats and trading options.
Lets you respond quickly to chart analysis without switching tools or panels.
Fixed-volume trade
Adjust the default volume in the order handler to a fixed or preferred lot size.
Simplifies execution by removing the need to adjust volume each time.
Quick-action terminal
Reposition controls horizontally and centre-align for a streamlined trading panel.
Enables faster access to both stats and trade buttons in compact setups.
TradeWatch Tab Sample simplifies trading workflows by combining real-time statistics and trading controls into a dedicated tab within Trade Watch. It updates automatically with the active chart, and its layout, symbol behaviour and trade settings can be customised to suit different trading styles or focus areas.