當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。