出力属性

概要

シールクラス OutputAttribute

備考

IndicatorDataSeries プロパティをチャートやパネルに表示するための出力としてマークします。これを有効にするには、表示する IndicatorDataSeries の宣言の前にこの属性を適用してください。

署名

1
public sealed class OutputAttribute : Attribute

 

名前空間

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
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample shows how to use indicators OuputAttribute
     [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class OutputAttributeSample : Indicator
     {
         [Output("Open", LineColor = "Red", IsHistogram = false, LineStyle = LineStyle.Dots, PlotType = PlotType.Line, Thickness = 2)]
         public IndicatorDataSeries OpenOutput { get; set; }
         [Output("High", LineColor = "Blue", IsHistogram = false, LineStyle = LineStyle.Solid, PlotType = PlotType.Line, Thickness = 2)]
         public IndicatorDataSeries HighOutput { get; set; }
         [Output("Low", LineColor = "Yellow", IsHistogram = false, LineStyle = LineStyle.Lines, PlotType = PlotType.Line, Thickness = 2)]
         public IndicatorDataSeries LowOutput { get; set; }
         [Output("Close", LineColor = "Green", IsHistogram = false, LineStyle = LineStyle.DotsRare, PlotType = PlotType.Line, Thickness = 2)]
         public IndicatorDataSeries CloseOutput { get; set; }
         protected override void Initialize()
         {
         }
         public override void Calculate(int index)
         {
             OpenOutput[index] = Bars.OpenPrices[index];
             HighOutput[index] = Bars.HighPrices[index];
             LowOutput[index] = Bars.LowPrices[index];
             CloseOutput[index] = Bars.ClosePrices[index];
         }
     }
 }

プロパティ

LineStyle

概要

指定された出力プロパティの線スタイルを取得または設定します。デフォルトでは Solid に設定されています。

備考

PlotType = PlotType.Line (デフォルト) の場合、LineStyle を追加できます。サポートされている線スタイルは次の通りです: Dots、DotsRare、DotsVeryRare、Lines、LinesDots、Solid

署名

1
public LineStyle LineStyle {get; set; }

 

戻り値

LineStyle

1
2
3
4
5
 //...
 //単純移動平均が Lines として描画されます。
 [Output("Simple Moving Average", LineStyle = LineStyle.Lines)]
 public IndicatorDataSeries SMA { get; set; }
 //...

Name

概要

プロット名

備考

インジケーターの新しいインスタンスを追加する際にユーザーインターフェースに表示されます。

署名

1
public string Name {get; }

 

戻り値

string

1
2
3
4
5
 //...
 //プロットされたインジケーター名は Simple Moving Average です。
 [Output("Simple Moving Average")]
 public IndicatorDataSeries SMA { get; set; }
 //...

Color

署名

1
public Colors Color {get; set; }

 

戻り値

Colors

LineColor

概要

出力プロパティの色を取得または設定します。この色は、この出力の線が描画されるときに使用されます。

署名

1
public string LineColor {get; set; }

 

戻り値

string

1
2
3
4
5
6
7
8
 //...
 //結果はターコイズ色で描画されます。
 [Output("Main", LineColor = "#008000")]
 public IndicatorDataSeries SMA { get; set; }
 public override void Calculate(int index)
 {
    //...
 }

Thickness

Summary

Sets the Width of the Output property.

Remarks

This Width will be used when the line for this Output is plotted.

Signature

1
public float Thickness {get; set;}

 

Return Value

float

Examples

1
2
3
4
5
6
7
8
 //...
 //The result is plotted as a line with thickness level five
 [Output("Simple Moving Average", Thickness = 5)]
 public IndicatorDataSeries SMA { get; set; }
 public override void Calculate(int index)
 {
     //...
 }

Related Tutorials

  • Controls

IsHistogram

Signature

1
public bool IsHistogram {get; set;}

 

Return Value

bool

PlotType

Summary

Plot type.

Remarks

The type of the output plotted on the output panel. Default = Line Supported types are: Line Points Histogram

Signature

1
public PlotType PlotType {get; set;}

 

Return Value

PlotType

Examples

1
2
3
4
5
6
7
8
 //...
 //The result is plotted as a Histogram.
 [Output("Commodity Channel Index", PlotType = PlotType.Histogram)]
 public IndicatorDataSeries SMA { get; set; }
 public override void Calculate(int index)
 {
     //...
 }

IsColorCustomizable

Summary

Sets if Output line color is customizable or not.

Remarks

This property is useful when you are setting line color manually with code via SetLineAppearance method.

Signature

1
public bool IsColorCustomizable {get; set;}

 

Return Value

bool

目次

このページについて