Skip to content

AspSymbolTab

interface cAlgo.API

DesktopCLICloud

Active symbol panel tab.

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 AspSymbolTab

Namespace: cAlgo.API · Group: Asp

Examples

Example 1

using cAlgo.API;

namespace cAlgo.Plugins
{
    public partial class Test : Plugin
    {
        protected override void OnStart()
        {
            var aspSymbolTabBlock = Asp.SymbolTab.AddBlock("Test Block");

            var panel = new StackPanel {Orientation = Orientation.Vertical};

            var webView = new WebView() {Height = 250};

            webView.Loaded += args => webView.NavigateAsync("https://ctrader.com/");

            panel.AddChild(webView);

            var removeBlockButton = new Button {Text = "Remove Block"};

            removeBlockButton.Click += args => Asp.SymbolTab.RemoveBlock(aspSymbolTabBlock);

            panel.AddChild(removeBlockButton);

            aspSymbolTabBlock.Child = panel;

            aspSymbolTabBlock.Height = 300;
        }
    }
}
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def on_start(self):
        aspSymbolTabBlock = api.Asp.SymbolTab.AddBlock("Test Block")

        panel = StackPanel()
        panel.Orientation = Orientation.Vertical

        webView = WebView()
        webView.Height = 250
        webView.Loaded += lambda _: webView.NavigateAsync("https://ctrader.com/")

        panel.AddChild(webView)

        removeBlockButton = Button()
        removeBlockButton.Text = "Remove Block"
        removeBlockButton.Click += lambda _: api.Asp.SymbolTab.RemoveBlock(aspSymbolTabBlock)

        panel.AddChild(removeBlockButton)

        aspSymbolTabBlock.Child = panel
        aspSymbolTabBlock.Height = 300
{
  "AccessRights": "None"
}

Example 2

using cAlgo.API;

namespace cAlgo.Plugins
{
    public partial class Test : Plugin
    {
        protected override void OnStart()
        {
            Print($"Current Active Symbol Panel symbol is: {Asp.SymbolTab.Symbol.Name}");

            Asp.SymbolTab.SymbolChanged += args => Print($"Active Symbol Panel symbol changed to: {args.NewSymbol.Name}");
        }
    }
}
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def on_start(self):
        print(f"Current Active Symbol Panel symbol is: {api.Asp.SymbolTab.Symbol.Name}")
        api.Asp.SymbolTab.SymbolChanged += lambda args: print(f"Active Symbol Panel symbol changed to: {args.NewSymbol.Name}")
{
  "AccessRights": "None"
}

Methods

Name Description
AddBlockDesktopCLICloudAspBlock Adds a new section block to active symbol panel.
RemoveBlock 2 overloadsDesktopCLICloudbool Removes a section block from active symbol panel.

Properties

Name Description
SymbolDesktopCLICloudSymbol Current symbol of Active symbol panel.

Events

Name Description
SymbolChangedDesktopCLICloudAction<AspSymbolChangedEventArgs> Occurs when active symbol panel selected symbol changes.

See also