Skip to content

Orientation

Summary

Defines the different orientations that panel layout can have.

Signature

1
public enum Orientation

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
22
23
24
25
26
27
28
29
30
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample indicator shows how to set stack and wrap panels orientation
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class OrientationSample : Indicator
     {
         [Parameter("Orientation", DefaultValue = Orientation.Vertical)]
         public Orientation Orientation { get; set; }
         protected override void Initialize()
         {
             var stackPanel = new StackPanel
             {
                 Orientation = Orientation,
                 HorizontalAlignment = HorizontalAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center,
                 BackgroundColor = Color.Gold,
                 Opacity = 0.7,
             };
             stackPanel.AddChild(new TextBlock { Text = "First TextBlock", FontWeight = FontWeight.ExtraBold, Margin = 5, ForegroundColor = Color.Black });
             stackPanel.AddChild(new TextBlock { Text = "Second TextBlock", FontWeight = FontWeight.ExtraBold, Margin = 5, ForegroundColor = Color.Black });
             stackPanel.AddChild(new TextBlock { Text = "Third TextBlock", FontWeight = FontWeight.ExtraBold, Margin = 5, ForegroundColor = Color.Black });
             stackPanel.AddChild(new TextBlock { Text = "Fourth TextBlock", FontWeight = FontWeight.ExtraBold, Margin = 5, ForegroundColor = Color.Black });
             Chart.AddControl(stackPanel);
         }
         public override void Calculate(int index)
         {
         }
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 import clr
 clr.AddReference("cAlgo.API")
 from cAlgo.API import *
 class Test():
     def get_text_block(self, text):
         textBlock = TextBlock()
         textBlock.Text = text
         textBlock.FontWeight = FontWeight.ExtraBold
         textBlock.ForegroundColor = Color.Black
         textBlock.Margin = Thickness(5)
         return textBlock
     def initialize(self):
         stackPanel = StackPanel()
         # Orientation is parameter of type Orientation defined in
         # indicator C# file
         stackPanel.Orientation = api.Orientation
         stackPanel.HorizontalAlignment = HorizontalAlignment.Center
         stackPanel.VerticalAlignment = VerticalAlignment.Center
         stackPanel.BackgroundColor = Color.Gold
         stackPanel.Opacity = 0.7
         stackPanel.AddChild(self.get_text_block("First TextBlock"))
         stackPanel.AddChild(self.get_text_block("Second TextBlock"))
         stackPanel.AddChild(self.get_text_block("Third TextBlock"))
         stackPanel.AddChild(self.get_text_block("Fourth TextBlock"))
         api.Chart.AddControl(stackPanel)

Fields

Horizontal

Summary

Elements in the panel layout should be horizontally oriented.

Signature

1
Orientation.Horizontal;

Return Value

Orientation

Vertical

Summary

Elements in the panel layout should be vertically oriented.

Signature

1
Orientation.Vertical;

Return Value

Orientation