本文整理汇总了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));
}