グリッド

cBots (自動売買)

概要

Gridクラスを表します。

シグネチャ

1
public class Grid : Panel

 

名前空間

cAlgo.API

 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
 using cAlgo.API;
 namespace cAlgo
 {
     // このサンプルは、Gridパネルコントロールの使い方を示します。
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class GridSample : Indicator
     {
         [Parameter("Grid Rows #", DefaultValue = 10)]
         public int GridRowsNumber { get; set; }
         [Parameter("Grid Columns #", DefaultValue = 2)]
         public int GridColumnsNumber { get; set; }
         [Parameter("Grid Row Length", DefaultValue = 2)]
         public int GridRowLength { get; set; }
         [Parameter("Grid Row Length Unit Type", DefaultValue = GridUnitType.Auto)]
         public GridUnitType GridRowLengthUnitType { get; set; }
         [Parameter("Grid Column Length", DefaultValue = 2)]
         public int GridColumnLength { get; set; }
         [Parameter("Grid Column Length Unit Type", DefaultValue = GridUnitType.Auto)]
         public GridUnitType GridColumnLengthUnitType { get; set; }
         protected override void Initialize()
         {
             var grid = new Grid(GridRowsNumber, GridColumnsNumber)
             {
                 BackgroundColor = Color.Gold,
                 Opacity = 0.6,
                 HorizontalAlignment = HorizontalAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center,
                 ShowGridLines = true,
             };
             for (int iRow = 0; iRow < GridRowsNumber; iRow++)
             {
                 var row = grid.Rows[iRow];
                 SetGridRowLength(row);
                 for (int iColumn = 0; iColumn < GridColumnsNumber; iColumn++)
                 {
                     var column = grid.Columns[iColumn];
                     SetGridColumnLength(column);
                     grid.AddChild(new TextBlock
                     {
                         Text = string.Format("Row {0} and Column {1}", iRow, iColumn),
                         Margin = 5,
                         ForegroundColor = Color.Black,
                         FontWeight = FontWeight.ExtraBold
                     }, iRow, iColumn);
                 }
             }
             Chart.AddControl(grid);
         }
         private void SetGridRowLength(GridRow row)
         {
             switch (GridRowLengthUnitType)
             {
                 case GridUnitType.Auto:
                     row.SetHeightToAuto();
                     break;
                 case GridUnitType.Pixel:
                     row.SetHeightInPixels(GridRowLength);
                     break;
                 case GridUnitType.Star:
                     row.SetHeightInStars(GridRowLength);
                     break;
             }
         }
         private void SetGridColumnLength(GridColumn <span="n">column)
         {
             switch (GridColumnLengthUnitType<span="p">)
             {
                 case GridUnitType.Auto<span="p">:
                     column<span="p">.SetWidthToAuto<span="p">();
                     break<span="p">;
                 case GridUnitType.Pixel<span="p">:
                     column<span="p">.SetWidthInPixels<span="p">(GridColumnLength<span="p">);
                     break<span="p">;
                 case GridUnitType<span="p">.<span="n">Star<span="p">:
                     column<span="p">.<span="n">SetWidthInStars<span="p">(GridColumnLength<span="p">);
                     break<span="p">;
             }
         }
         public override void Calculate(int index<span="p">)
         {
         <span="p">}
     <span="p">}
 <span="p">}

関連項目

  • cAlgo.API.Panel

メソッド

AddChild (2)

AddChild (1 of 2)

概要

子要素を追加します。

シグネチャ

1
public void AddChild(ControlBase child, int row<span="p">, int column<span="p">)

 

パラメータ

名前タイプ説明
childControlBase子要素。
rowint行。
columnint列。

戻り値

void

概要

ロボットインスタンスの事前定義された状態を表します。

シグネチャ

1
public enum RobotState

 

名前空間

cAlgo.API

フィールド

Stopped

概要

ロボットインスタンスが停止しています。

シグネチャ

1
public static RobotState Stopped;

 

戻り値

RobotState

Running

概要

ロボットインスタンスが実行中です。

シグネチャ

1
public static RobotState Running;

 

戻り値

RobotState

Stopping

概要

停止が要求されましたが、ロボットインスタンスはまだ停止していません

シグネチャ

1
public static RobotState Stopping;

 

戻り値

RobotState

Restarting

概要

クラッシュやパラメータ、シンボル、アカウントの変更などによりロボットインスタンスが再起動しています。

シグネチャ

1
public static RobotState Restarting;

 

戻り値

RobotState