当前位置: 首页>>代码示例>>C#>>正文


C# BarData类代码示例

本文整理汇总了C#中BarData的典型用法代码示例。如果您正苦于以下问题:C# BarData类的具体用法?C# BarData怎么用?C# BarData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BarData类属于命名空间,在下文中一共展示了BarData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: switch

		public double this[DateTime dateTime, BarData barData]
		{
			get
			{
				Bar bar = this[dateTime];
				switch (barData)
				{
				case BarData.Close:
					return bar.Close;
				case BarData.Open:
					return bar.Open;
				case BarData.High:
					return bar.High;
				case BarData.Low:
					return bar.Low;
				case BarData.Median:
					return bar.Median;
				case BarData.Typical:
					return bar.Typical;
				case BarData.Weighted:
					return bar.Weighted;
				case BarData.Average:
					return bar.Average;
				case BarData.Volume:
					return (double)bar.Volume;
				case BarData.OpenInt:
					return (double)bar.OpenInt;
				default:
					throw new NotSupportedException("BarData " + barData + " is not supported");
				}
			}
		}
开发者ID:houzhongxu,项目名称:OpenQuant.API,代码行数:32,代码来源:BarSeries.cs

示例2:

		public override double this[int index, BarData barData]
		{
			get
			{
				return this[index][barData];
			}
		}
开发者ID:heber,项目名称:FreeOQ,代码行数:7,代码来源:PnFSeries.cs

示例3: Value

 // TODO: rewrite
 public static double Value(ISeries input, int index, int length, BarData barData = BarData.Close, RegressionDistanceMode distanceMode = RegressionDistanceMode.Time)
 {
     if (index >= length - 1)
     {
         double num = 0.0;
         double num2 = 0.0;
         double num3 = 0.0;
         double num4 = 0.0;
         if (distanceMode == RegressionDistanceMode.Time)
         {
             double num5 = input.GetDateTime(index).Subtract(input.GetDateTime(index - 1)).Ticks;
             for (int i = index; i > index - length; i--)
             {
                 num += input.GetDateTime(i).Subtract(input.GetDateTime(index - length + 1)).Ticks / num5;
                 num2 += input.GetDateTime(i).Subtract(input.GetDateTime(index - length + 1)).Ticks / num5 * input[i, barData];
                 num3 += input[i, barData];
                 num4 += input.GetDateTime(i).Subtract(input.GetDateTime(index - length + 1)).Ticks / num5 * input.GetDateTime(i).Subtract(input.GetDateTime(index - length + 1)).Ticks / num5;
             }
         }
         else
         {
             for (int j = index; j > index - length; j--)
             {
                 num += j - index + length - 1;
                 num2 += (j - index + length - 1) * input[j, barData];
                 num3 += input[j, barData];
                 num4 += ((j - index + length - 1) * (j - index + length - 1));
             }
         }
         return (length * num2 - num * num3) / (length * num4 - Math.Pow(num, 2.0));
     }
     return double.NaN;
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:34,代码来源:LRS.cs

示例4: LRS

		public LRS(ISeries input, int length, BarData barData = BarData.Close, RegressionDistanceMode distanceMode = RegressionDistanceMode.Time) : base(input)
		{
			this.length = length;
			this.barData = barData;
			this.distanceMode = distanceMode;
			this.Init();
		}
开发者ID:ForTrade,项目名称:CSharp,代码行数:7,代码来源:LRS.cs

示例5: DPO1

 public DPO1(ISeries series, int length, BarData barData)
     : base(series)
 {
     this.length = length;
     this.option = barData;
     this.Name = "DPO";
 }
开发者ID:ForTrade,项目名称:OpenQuant,代码行数:7,代码来源:DPO1.cs

示例6: DPO1

 public DPO1(ISeries series, int length, BarData barData)
     : base(series)
 {
     this.length = length;//长度
     this.option = barData;//bar类型
     this.Name = "DPO";//名称
 }
开发者ID:vcfriend,项目名称:OpenQuant,代码行数:7,代码来源:DPO1.cs

示例7: ENVU

		public ENVU(ISeries input, int length, double shift, BarData barData = BarData.Close) : base(input)
		{
			this.length = length;
			this.shift = shift;
			this.barData = barData;
			this.Init();
		}
开发者ID:ForTrade,项目名称:CSharp,代码行数:7,代码来源:ENVU.cs

示例8: HV

 public HV(ISeries input, int length, double span, BarData barData = BarData.Close) : base(input)
 {
     this.length = length;
     this.span = span;
     this.barData = barData;
     Init();
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:7,代码来源:HV.cs

示例9: SMA

		public SMA(TimeSeries input, int length, BarData option, Color color) : base(input)
		{
			this.fLength = length;
			this.fOption = option;
			this.Init();
			this.Color = color;
		}
开发者ID:heber,项目名称:FreeOQ,代码行数:7,代码来源:SMA.cs

示例10: PERF

		public PERF(TimeSeries input, double k, BarData option)	: base(input) 
    {
      this.fK = 14.0;
      this.fOption = option;
      this.fK = k;
      this.Init();
    }
开发者ID:heber,项目名称:FreeOQ,代码行数:7,代码来源:PERF.cs

示例11: EMA

		public EMA(TimeSeries input, int length, BarData option)	: base(input) 
    {
      this.fLength = 14;
      this.fLength = length;
      this.fOption = option;
      this.Init();
    }
开发者ID:heber,项目名称:FreeOQ,代码行数:7,代码来源:EMA.cs

示例12:

		public double this[int index, BarData barData]
		{
			get
			{
				return this.series[index];
			}
		}
开发者ID:houzhongxu,项目名称:OpenQuant.API,代码行数:7,代码来源:TimeSeries.cs

示例13:

		public double this[DateTime dateTime, BarData barData]
		{
			get
			{
				return this.series[dateTime];
			}
		}
开发者ID:heber,项目名称:FreeOQ,代码行数:7,代码来源:TimeSeries.cs

示例14: OSC

		public OSC(ISeries input, int length1, int length2, BarData barData = BarData.Close) : base(input)
		{
			this.length1 = length1;
			this.length2 = length2;
			this.barData = barData;
			this.Init();
		}
开发者ID:ForTrade,项目名称:CSharp,代码行数:7,代码来源:OSC.cs

示例15: RSI

    public RSI(TimeSeries input, int length, BarData option, EIndicatorStyle style)
			: base(input){
      this.fLength = 14;
      this.fLength = length;
      this.fOption = option;
      this.fStyle = style;
      this.Init();
    }
开发者ID:heber,项目名称:FreeOQ,代码行数:8,代码来源:RSI.cs


注:本文中的BarData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。