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


C# Pad.WorldY方法代码示例

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


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

示例1: GetPadRangeY

		public PadRange GetPadRangeY(Pad pad)
		{
			DateTime now = Clock.Now;
			FIXExecutionReport fIXExecutionReport = null;
			if (this.order.Reports.Count != 0)
			{
				fIXExecutionReport = this.order.Reports[this.order.Reports.Count - 1];
			}
			if (fIXExecutionReport == null)
			{
				return new PadRange(0.0, 0.0);
			}
			if (this.order.OrdType == OrdType.Market && this.order.OrdStatus != OrdStatus.Filled)
			{
				return new PadRange(0.0, 0.0);
			}
			FIXExecutionReport fIXExecutionReport2 = this.order.Reports[0];
			DateTime t = new DateTime((long)pad.XMin);
			DateTime t2 = new DateTime((long)pad.XMax);
			DateTime transactTime = fIXExecutionReport2.TransactTime;
			DateTime t3;
			if (this.order.OrdStatus == OrdStatus.Filled || this.order.OrdStatus == OrdStatus.Cancelled || this.order.OrdStatus == OrdStatus.Rejected)
			{
				t3 = fIXExecutionReport.TransactTime;
			}
			else
			{
				t3 = now;
			}
			if (!(t <= t3) || !(t2 >= transactTime) || this.order.OrdStatus == OrdStatus.Cancelled || this.order.OrdStatus == OrdStatus.Rejected)
			{
				return new PadRange(0.0, 0.0);
			}
			double val = this.order.AvgPx - 1E-10;
			double val2 = this.order.AvgPx + 1E-10;
			if (this.order.OrdType == OrdType.Limit)
			{
				int clientY = pad.ClientY(this.order.Price);
				if (this.order.Side == Side.Buy)
				{
					val2 = pad.WorldY(clientY);
					val = this.order.Price;
				}
				else
				{
					val = pad.WorldY(clientY);
					val2 = this.order.Price;
				}
			}
			if (this.order.OrdType == OrdType.Stop)
			{
				int clientY2 = pad.ClientY(this.order.StopPx);
				if (this.order.Side != Side.Buy)
				{
					val2 = pad.WorldY(clientY2);
					val = this.order.StopPx;
				}
				else
				{
					val = pad.WorldY(clientY2);
					val2 = this.order.StopPx;
				}
			}
			if (this.order.OrdType == OrdType.StopLimit)
			{
				int clientY3 = pad.ClientY(this.order.Price);
				int clientY4 = pad.ClientY(this.order.StopPx);
				if (this.order.Side == Side.Buy)
				{
					val2 = pad.WorldY(clientY3);
					val = pad.WorldY(clientY4);
				}
				else
				{
					val = pad.WorldY(clientY3);
					val2 = pad.WorldY(clientY4);
				}
			}
			return new PadRange(Math.Min(val, val2), Math.Max(val, val2));
		}
开发者ID:houzhongxu,项目名称:OpenQuant.API,代码行数:80,代码来源:OrderMarker.cs


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