• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ISeries类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Value

		public static double Value(ISeries input, int index)
		{
			if (index >= 1)
			{
				double num = input[index, BarData.Close];
				double num2 = input[index - 1, BarData.Close];
				double num3 = input[index, BarData.Volume];
				double num4 = input[index - 1, BarData.Volume];
				double num5 = PVI.Value(input, index - 1);
				double result;
				if (num3 > num4)
				{
					result = num5 + num5 * (num - num2) / num2;
				}
				else
				{
					result = num5;
				}
				return result;
			}
			if (index == 0)
			{
				return 10000.0;
			}
			return double.NaN;
		}
开发者ID:ForTrade,项目名称:CSharp,代码行数:26,代码来源:PVI.cs


示例17: Repair

		/// <summary>
		/// Initialize a new instance of the Repair class.
		/// </summary>
		/// <param name="publisher">The publisher.</param>
		/// <param name="series">The series.</param>
		/// <param name="chapter">The chapter.</param>
		/// <param name="comicInfo">The comic information.</param>
		/// <param name="brokenPages">Each broken page.</param>
		public Repair(IPublisher publisher, ISeries series, IChapter chapter, ComicInfo comicInfo, IEnumerable<string> brokenPages) {
			_brokenPages = brokenPages;
			_chapter = chapter;
			_comicInfo = comicInfo;
			_publisher = publisher;
			_series = series;
		}
开发者ID:Kokoro87,项目名称:mangarack.cs,代码行数:15,代码来源:Repair.cs


示例18: Value

		public static double Value(ISeries input, int index)
		{
			if (index >= 0)
			{
				double num = input[index, BarData.High];
				double num2 = input[index, BarData.Low];
				double num3 = input[index, BarData.Close];
				double arg_2A_0 = input[index, BarData.Open];
				double num4 = input[index, BarData.Volume];
				double result = 0.0;
				if (index >= 1)
				{
					if (num != num2)
					{
						result = num4 * (num3 - num2 - (num - num3)) / (num - num2) + AD.Value(input, index - 1);
					}
					else
					{
						result = AD.Value(input, index - 1);
					}
				}
				else
				{
					if (index == 0 && num != num2)
					{
						result = num4 * (num3 - num2 - (num - num3)) / (num - num2);
					}
				}
				return result;
			}
			return double.NaN;
		}
开发者ID:ForTrade,项目名称:CSharp,代码行数:32,代码来源:AD.cs


示例19: SAR

		public SAR(ISeries input, double upperBound, double step, double initialAcc) : base(input)
		{
			this.upperBound = upperBound;
			this.step = step;
			this.initialAcc = initialAcc;
			this.Init();
		}
开发者ID:ForTrade,项目名称:CSharp,代码行数:7,代码来源:SAR.cs


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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IServer类代码示例发布时间:2022-05-24
下一篇:
C# ISerializer类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap