チャートテキスト

概要

テキストチャートオブジェクトを表します。チャート上の任意の場所にテキストを配置し、チャートにバインドできます。

署名

1
public abstract interface ChartText

 

名前空間

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
 using cAlgo.API;
 namespace cAlgo
 {
     // このサンプルは Chart.DrawText メソッドを使用してテキストを描画する方法を示しています
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class ChartTextSample : Indicator
     {
         protected override void Initialize()
         {
             for (int iBarIndex = Chart.FirstVisibleBarIndex; iBarIndex <= Chart.LastVisibleBarIndex; iBarIndex++)
             {
                 string text;
                 double y;
                 Color color;
                 if (Bars.ClosePrices[iBarIndex] > Bars.OpenPrices[iBarIndex])
                 {
                     text = "U";
                     y = Bars.LowPrices[iBarIndex];
                     color = Color.Green;
                 }
                 else
                 {
                     text = "D";
                     y = Bars.HighPrices[iBarIndex];
                     color = Color.Red;
                 }
                 Chart.DrawText("Text_" + iBarIndex, text, iBarIndex, y, color);
             }
         }
         public override void Calculate(int index)
         {
         }
     }
 }

関連情報

  • cAlgo.API.ChartObject

プロパティ

名前アクセス権限説明
GetTextstring読み取り専用テキストを取得します。
SetTextstring書き込み専用テキストを設定します。

メソッド

名前引数戻り値の型説明
DrawTextstring text, double x, double y, Color colorvoid指定された位置にテキストを描画します。
目次

このページについて