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


C# ISeries.GetDateTime方法代码示例

本文整理汇总了C#中ISeries.GetDateTime方法的典型用法代码示例。如果您正苦于以下问题:C# ISeries.GetDateTime方法的具体用法?C# ISeries.GetDateTime怎么用?C# ISeries.GetDateTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISeries的用法示例。


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

示例1: 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

示例2: Value

		public static double Value(ISeries input, int index, int length1, int length2)
		{
			if (index >= length1 - 1 && index >= length2 - 1)
			{
				TimeSeries timeSeries = new TimeSeries();
				for (int i = index - Math.Max(length1, length2) + 1; i <= index; i++)
				{
					timeSeries.Add(input.GetDateTime(i), input[i, BarData.Volume]);
				}
				double num = SMA.Value(timeSeries, length1 - 1, length1, BarData.Close);
				double num2 = SMA.Value(timeSeries, length2 - 1, length2, BarData.Close);
				return num - num2;
			}
			return double.NaN;
		}
开发者ID:ForTrade,项目名称:CSharp,代码行数:15,代码来源:VOSC.cs

示例3: Value

		public static double Value(ISeries input, int index, int length, BarData barData = BarData.Close)
		{
			if (index >= 1)
			{
				TimeSeries timeSeries = new TimeSeries();
				for (int i = 0; i <= index; i++)
				{
					timeSeries.Add(input.GetDateTime(i), input[i, barData]);
				}
				EMA input2 = new EMA(timeSeries, length, barData);
				EMA input3 = new EMA(input2, length, barData);
				EMA eMA = new EMA(input3, length, barData);
				return (eMA[index] - eMA[index - 1]) / eMA[index - 1] * 100.0;
			}
			return double.NaN;
		}
开发者ID:ForTrade,项目名称:CSharp,代码行数:16,代码来源:TRIX.cs

示例4: Value

		public static double Value(ISeries input, int index, int length1, int length2)
		{
			if (index >= length2 - 1)
			{
				TimeSeries timeSeries = new TimeSeries();
				for (int i = 0; i <= index; i++)
				{
					timeSeries.Add(input.GetDateTime(i), input[i, BarData.High] - input[i, BarData.Low]);
				}
				EMA eMA = new EMA(timeSeries, length1, BarData.Close);
				return (eMA[index] - eMA[index - length2 + 1]) / eMA[index - length2 + 1] * 100.0;
			}
			return double.NaN;
		}
开发者ID:ForTrade,项目名称:CSharp,代码行数:14,代码来源:VCH.cs

示例5: Value

		public static double Value(ISeries input, int index, int length, int order)
		{
			if (index >= length - 1)
			{
				TimeSeries timeSeries = new TimeSeries();
				for (int i = 0; i <= index; i++)
				{
					timeSeries.Add(input.GetDateTime(i), input[i, BarData.High] - input[i, BarData.Low]);
				}
				EMA eMA = new EMA(timeSeries, order, BarData.Close);
				EMA eMA2 = new EMA(eMA, order, BarData.Close);
				double num = 0.0;
				for (int j = index; j > index - length; j--)
				{
					num += eMA[j] / eMA2[j];
				}
				return num;
			}
			return double.NaN;
		}
开发者ID:ForTrade,项目名称:CSharp,代码行数:20,代码来源:MASS.cs


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