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


C# ISeries类代码示例

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


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

示例1: Save

		/// <summary>
		///   儲存交易報表(CSV格式)
		/// </summary>
		/// <param name="filename">欲儲存的檔案</param>
		/// <param name="symbolId">商品名稱</param>
		/// <param name="positions">商品交易的倉位資訊</param>
		public static void Save(string filename, string symbolId, ISeries<IMarketPosition> positions) {
			if (File.Exists(filename)) {
				File.Delete(filename);
			}

			PositionSeries cPositions = positions as PositionSeries;
			StringBuilder cBuilder = new StringBuilder(1024 * 1024);
			cBuilder.Append("NO.").Append(',').Append("SymbolID").Append(',').Append("Category").Append(',').Append("Action").Append(',').Append("Volume").Append(',').Append("Price").Append(',').Append("Profit").Append(',').Append("Fee").Append(',').Append("Tax").Append(',').Append("Trading time").Append(',').AppendLine("Description");

			int iCount = cPositions.Count;
			for (int i = 0; i < iCount; i++) {
				IMarketPosition cPosition = cPositions[i];
				if (cPosition.Value > 0) {
					List<ITrade> cTrades = cPosition.ClosedTrades;
					foreach (ITrade cTrade in cTrades) {
						ITradeOrder cOpenO = cTrade.EntryOrder;
						ITradeOrder cCloseO = cTrade.ExitOrder;

						cBuilder.Append(cOpenO.Ticket).Append(',').Append(symbolId).Append(',').Append(cOpenO.Category).Append(',').Append(cOpenO.Action).Append(',').Append(cOpenO.Contracts).Append(',').Append(cOpenO.Price).Append(',').Append(string.Empty).Append(',').Append(cOpenO.Fee).Append(',').Append(cOpenO.Tax).Append(',').Append(cOpenO.Time.ToString("yyyy/MM/dd HH:mm:ss")).Append(',').AppendLine(cOpenO.Name);
						cBuilder.Append(cCloseO.Ticket).Append(',').Append(symbolId).Append(',').Append(cCloseO.Category).Append(',').Append(cCloseO.Action).Append(',').Append(cCloseO.Contracts).Append(',').Append(cCloseO.Price).Append(',').Append(cTrade.Profit).Append(',').Append(cCloseO.Fee).Append(',').Append(cCloseO.Tax).Append(',').Append(cCloseO.Time.ToString("yyyy/MM/dd HH:mm:ss")).Append(',').AppendLine(cCloseO.Name);
					}
				}
			}
			File.WriteAllText(filename, cBuilder.ToString(), Encoding.UTF8);
		}
开发者ID:Zeghs,项目名称:ZeroSystem,代码行数:31,代码来源:TradeReport.cs

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

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

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

示例7: Value

		public static double Value(ISeries input, int index, int length)
		{
			if (index >= length)
			{
				double num = 0.0;
				double num2 = 0.0;
				for (int i = index; i > index - length; i--)
				{
					double num3 = input[i, BarData.Typical];
					double num4 = input[i - 1, BarData.Typical];
					double num5 = input[i, BarData.Volume];
					double arg_48_0 = input[i - 1, BarData.Volume];
					if (num3 > num4)
					{
						num += num3 * num5;
					}
					else
					{
						num2 += num3 * num5;
					}
				}
				double num6 = num / num2;
				return 100.0 - 100.0 / (1.0 + num6);
			}
			return double.NaN;
		}
开发者ID:ForTrade,项目名称:CSharp,代码行数:26,代码来源:MFI.cs

示例8: Value

		public static double Value(ISeries input, int index)
		{
			if (index < 1)
			{
				return double.NaN;
			}
			double num = input[index, BarData.High];
			double num2 = input[index, BarData.Low];
			double num3 = input[index - 1, BarData.High];
			double num4 = input[index - 1, BarData.Low];
			double num5 = 0.0;
			double num6 = 0.0;
			if (num > num3)
			{
				num5 = num - num3;
			}
			if (num2 < num4)
			{
				num6 = num4 - num2;
			}
			if (num5 > num6)
			{
				return num5;
			}
			return 0.0;
		}
开发者ID:ForTrade,项目名称:CSharp,代码行数:26,代码来源:PDM.cs

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

示例10: Value

 public static double Value(ISeries input, int index, int length)
 {
     return index < length - 1
         ? double.NaN
         : (input[index, BarData.Volume] - input[index - length + 1, BarData.Volume])/
           input[index - length + 1, BarData.Volume]*100;
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:7,代码来源:VROC.cs

示例11: Value

		public static double Value(ISeries input, int index)
		{
			double result = 0.0;
			if (index >= 1)
			{
				double val = input[index, BarData.High];
				double val2 = input[index, BarData.Low];
				double num = input[index, BarData.Close];
				double num2 = input[index - 1, BarData.Close];
				double arg_3D_0 = input[index, BarData.Volume];
				if (num > num2)
				{
					result = WAD.Value(input, index - 1) + num - Math.Min(val2, num2);
				}
				if (num < num2)
				{
					result = WAD.Value(input, index - 1) + num - Math.Max(val, num2);
				}
				if (num == num2)
				{
					result = WAD.Value(input, index - 1);
				}
			}
			return result;
		}
开发者ID:ForTrade,项目名称:CSharp,代码行数:25,代码来源:WAD.cs

示例12: GetNearestPoint

        private static DataPoint? GetNearestPoint(ISeries s, ScreenPoint point, bool snap, bool pointsOnly)
        {
            if (s == null)
                return null;

            if (snap || pointsOnly)
            {
                ScreenPoint spn;
                DataPoint dpn;
                if (s.GetNearestPoint(point, out dpn, out spn) && snap)
                {
                    if (spn.DistanceTo(point) < 20)
                        return dpn;
                }
            }

            ScreenPoint sp;
            DataPoint dp;

            if (!pointsOnly)
                if (s.GetNearestInterpolatedPoint(point, out dp, out sp))
                    return dp;

            return null;
        }
开发者ID:AndrewTPohlmann,项目名称:open-hardware-monitor,代码行数:25,代码来源:SliderAction.cs

示例13: UltOsc

		public UltOsc(ISeries input, int n1, int n2, int n3) : base(input)
		{
			this.n1 = n1;
			this.n2 = n2;
			this.n3 = n3;
			this.Init();
		}
开发者ID:ForTrade,项目名称:CSharp,代码行数:7,代码来源:UltOsc.cs

示例14: D_Slow

 public D_Slow(ISeries input, int length, int order1, int order2) : base(input)
 {
     this.length = length;
     this.order1 = order1;
     this.order2 = order2;
     Init();
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:7,代码来源:D_Slow.cs

示例15: RectangleRenderableSeries

 public RectangleRenderableSeries(ISeries series)
 {
     ResamplingMode = ResamplingMode.None;
     DataSeries = series;
     IsVisible = true;
     base.DataSeries = new DummyDataSeries(series);
 }
开发者ID:jairov4,项目名称:RectangleChartSeries,代码行数:7,代码来源:RectangleRenderableSeries.cs


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