Skip to content

AspSymbolTab

Summary

Active symbol panel tab.

Signature

1
public abstract interface AspSymbolTab

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
 using cAlgo.API;
 namespace cAlgo.Plugins
 {
     [Plugin(AccessRights = AccessRights.None)]
     public 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;
         }
     }        
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 using cAlgo.API;
 namespace cAlgo.Plugins
 {
     [Plugin(AccessRights = AccessRights.None)]
     public 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}");
         }
     }        
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
 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
1
2
3
4
5
6
7
 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}")

See Also

Methods

AddBlock

Summary

Adds a new section block to active symbol panel.

Signature

1
public abstract AspBlock AddBlock(string title)

Parameters

Name Type Description
title string Block title

Return Value

AspBlock

RemoveBlock (2)

RemoveBlock (1 of 2)

Summary

Removes a section block from active symbol panel.

Signature

1
public abstract bool RemoveBlock(string id)

Parameters

Name Type Description
id string Block Id

Return Value

bool

RemoveBlock (2 of 2)

Summary

Removes a section block from active symbol panel.

Signature

1
public abstract bool RemoveBlock(AspBlock block)

Parameters

Name Type Description
block AspBlock Block

Return Value

bool

Properties

Symbol

Summary

Current symbol of Active symbol panel.

Signature

1
public abstract Symbol Symbol {get;}

Return Value

Symbol

Events

SymbolChanged

Summary

Occurs when active symbol panel selected symbol changes.

Signature

1
public abstract event Action<AspSymbolChangedEventArgs> SymbolChanged;