public InstrumentPad(Pad pad) { this.pad = pad; this.padSizes = new Hashtable(); pad.Chart.GroupRightMarginEnabled = true; pad.Chart.GroupRightMarginEnabled = true; }
private void qDx3lDiW7U(Pad pad, Bitmap bitmap) { if (this.Look != EChartLook.SurfaceOnly) return; Graphics g = Graphics.FromImage(bitmap); TView.View(pad).PaintAxes(g, pad, 0, 0, this.C843M1JDuK); }
public override void Paint(Pad pad, double minX, double maxX, double minY, double maxY) { base.Paint(pad, minX, maxX, minY, maxY); if (this.Text == null) return; int num1 = (int) pad.Graphics.MeasureString(this.Text, this.TextFont).Width; int num2 = (int) pad.Graphics.MeasureString(this.Text, this.TextFont).Height; switch (this.TextPosition) { case ETextPosition.RightTop: pad.Graphics.DrawString(this.Text, this.TextFont, new SolidBrush(this.TextColor), (float) (pad.ClientX(this.fX) + this.TextOffsetX), (float) (pad.ClientY(this.fY) - num2 - this.TextOffsetY)); break; case ETextPosition.LeftTop: pad.Graphics.DrawString(this.Text, this.TextFont, new SolidBrush(this.TextColor), (float) (pad.ClientX(this.fX) - num1 - this.TextOffsetX), (float) (pad.ClientY(this.fY) - num2 - this.TextOffsetY)); break; case ETextPosition.CentreTop: pad.Graphics.DrawString(this.Text, this.TextFont, (Brush) new SolidBrush(this.TextColor), (float) (pad.ClientX(this.fX) - num1 / 2 - this.TextOffsetX), (float) (pad.ClientY(this.fY) - num2 - this.TextOffsetY)); break; case ETextPosition.RightBottom: pad.Graphics.DrawString(this.Text, this.TextFont, (Brush) new SolidBrush(this.TextColor), (float) (pad.ClientX(this.fX) + this.TextOffsetX), (float) (pad.ClientY(this.fY) + this.Size / 2 + this.TextOffsetY)); break; case ETextPosition.LeftBottom: pad.Graphics.DrawString(this.Text, this.TextFont, (Brush) new SolidBrush(this.TextColor), (float) (pad.ClientX(this.fX) - num1 - this.TextOffsetX), (float) (pad.ClientY(this.fY) + this.Size / 2 + this.TextOffsetY)); break; case ETextPosition.CentreBottom: pad.Graphics.DrawString(this.Text, this.TextFont, (Brush) new SolidBrush(this.TextColor), (float) (pad.ClientX(this.fX) - num1 / 2 - this.TextOffsetX), (float) (pad.ClientY(this.fY) + this.Size / 2 + this.TextOffsetY)); break; } }
public PadProperyForm(object Object, Pad Pad) : base() { this.InitializeComponent(); this.KtO3rBrbaI = Object; this.evD3c4dHMV = Pad; this.Text = Object.GetType().Name + "Pad"; this.propertyGrid.SelectedObject = Object; }
public virtual void Paint(Pad pad, double xMin, double xMax, double yMin, double yMax) { pad.DrawLine(new Pen(this.Color) { Width = this.Width, DashStyle = this.DashStyle }, this.X1, this.Y1, this.X2, this.Y2); }
public unsafe void Paint(Pad pad) { TView tview = TView.View(pad); this.uq63OYZaax = tview.Left; this.FP43FHdtWy = tview.Top; this.Jm23JdRAV2 = tview.H; this.C843M1JDuK = tview.H; this.Sp23PRDLnW = tview.o - new TVec3((double)this.uq63OYZaax, (double)this.FP43FHdtWy, 0.0); this.tn83Ged55u = tview.Lx; this.PqY3RZfYIU = tview.Ly; this.gcU3NtonPe = tview.Lz; this.trP3fdnMpS = tview.Light; if (this.Look == EChartLook.SurfaceOnly) this.hH1321Stt8 = false; Bitmap bitmap = new Bitmap(this.Jm23JdRAV2, this.C843M1JDuK, PixelFormat.Format32bppRgb); this.qDx3lDiW7U(pad, bitmap); Rectangle rect = new Rectangle(0, 0, this.Jm23JdRAV2, this.C843M1JDuK); BitmapData bitmapdata = bitmap.LockBits(rect, this.hH1321Stt8 ? ImageLockMode.WriteOnly : ImageLockMode.ReadWrite, PixelFormat.Format32bppRgb); this.Pnx3KTVZoc((int*)bitmapdata.Scan0.ToPointer()); bitmap.UnlockBits(bitmapdata); Color transparentColor = Color.FromArgb((int)byte.MaxValue, 0, 0, 0); bitmap.MakeTransparent(transparentColor); pad.Graphics.DrawImage((Image)bitmap, this.uq63OYZaax, this.FP43FHdtWy); }
public void uDx3gBDtTM(Pad obj0, double[,] obj1, int obj2, int obj3, double obj4, double obj5, double obj6, double obj7, double obj8, double obj9, Color[] obj10) { this.umVNE9P5cO(obj0, obj1, obj2, obj3, obj4, obj5, obj6, obj7, obj9); this.EbV3bis37P = new TColor[obj10.Length]; for (int index = 0; index < this.EbV3bis37P.Length; ++index) this.EbV3bis37P[index] = (TColor) obj10[index]; this.LSr3HnRJss = (double) (this.EbV3bis37P.Length - 1) / (obj9 - obj8) / this.DQY3XkBEnm; this.jaO3EZAeXk = obj8 * this.DQY3XkBEnm; }
public virtual void umVNE9P5cO(Pad obj0, double[,] obj1, int obj2, int obj3, double obj4, double obj5, double obj6, double obj7, double obj8) { this.pwU3ia0tgu = obj1; this.nx = obj2; this.ny = obj3; this.MinX = obj4; this.MaxX = obj5; this.MinY = obj6; this.MaxY = obj7; this.aqv3D4FyQP = obj8; this.YGZ38gIuF2 = (double) obj2 / (obj5 - obj4); this.drs3Z0OsMo = (double) obj3 / (obj7 - obj6); this.DQY3XkBEnm = TView.View(obj0).Lz.NormInf / this.aqv3D4FyQP; }
public void Paint(Pad pad, double minX, double maxX, double minY, double maxY) { int num1 = pad.ClientX(this.DateTime.Ticks); int num2 = pad.ClientY(this.Price); // USaG3GpjZagj1iVdv4u.Y4misFk9D9(11044) + this.RxjAeNd9om.ToString(USaG3GpjZagj1iVdv4u.Y4misFk9D9(11064)) + USaG3GpjZagj1iVdv4u.Y4misFk9D9(11072) + ((object) this.Status).ToString() + USaG3GpjZagj1iVdv4u.Y4misFk9D9(11080); Font font = new Font("Arial", 8); Color color = this.BuyColor; switch (this.Side) { case SignalSide.Buy: color = this.BuyColor; break; case SignalSide.BuyCover: color = this.BuyCoverColor; break; case SignalSide.Sell: color = this.SellColor; break; case SignalSide.SellShort: color = this.SellShortColor; break; } Pen pen = new Pen(color, 2f); int num3 = 8; double num4 = pad.ClientX(minX); double num5 = pad.ClientX(maxX); if ((double)(num1 - num3 / 2) > num5 || (double)(num1 + num3 / 2) < num4) return; pad.Graphics.DrawEllipse(pen, num1 - num3 / 2, num2 - num3 / 2, num3, num3); }
public void Paint(Pad Pad, double MinX, double MaxX, double MinY, double MaxY) { if ((double)this.DateTime.Ticks > MaxX || (double)this.DateTime.Ticks < MinX) return; int x = Pad.ClientX((double)this.DateTime.Ticks); int y = Pad.ClientY(this.Price); float num1 = 12f; string str = ((object)this.Side).ToString() + (string)(object)this.Qty + this.Instrument.Symbol + this.Price.ToString(); Font font = new Font("airal", 8f); switch (this.Side) { case Side.Buy: Color color1 = this.buyColor; PointF[] points1 = new PointF[3] { (PointF)new Point(x, y), (PointF)new Point((int)((double)x - (double)num1 / 2.0), (int)((double)y + (double)num1 / 2.0)), (PointF)new Point((int)((double)x + (double)num1 / 2.0), (int)((double)y + (double)num1 / 2.0)) }; Pad.Graphics.DrawPolygon(new Pen(Color.Black), points1); Pad.Graphics.DrawRectangle(new Pen(Color.Black), (float)x - num1 / 4f, (float)y + num1 / 2f, num1 / 2f, num1 / 2f); Pad.Graphics.FillPolygon((Brush)new SolidBrush(color1), points1); Pad.Graphics.FillRectangle((Brush)new SolidBrush(color1), (float)x - num1 / 4f, (float)((double)y + (double)num1 / 2.0 - 1.0), num1 / 2f, (float)((double)num1 / 2.0 + 1.0)); break; case Side.Sell: Color color2 = this.sellColor; Point[] points2 = new Point[3] { new Point(x, y), new Point((int)((double)x - (double)num1 / 2.0), (int)((double)y - (double)num1 / 2.0)), new Point((int)((double)x + (double)num1 / 2.0), (int)((double)y - (double)num1 / 2.0)) }; Pad.Graphics.DrawPolygon(new Pen(Color.Black), points2); Pad.Graphics.DrawRectangle(new Pen(Color.Black), (float)x - num1 / 4f, (float)y - num1, num1 / 2f, (float)((double)num1 / 2.0 + 1.0)); Pad.Graphics.FillPolygon((Brush)new SolidBrush(color2), points2); Pad.Graphics.FillRectangle((Brush)new SolidBrush(color2), (float)x - num1 / 4f, (float)y - num1, num1 / 2f, (float)((double)num1 / 2.0 + 1.0)); break; case Side.SellShort: Color color3 = this.sellShortColor; Point[] points3 = new Point[3] { new Point(x, y), new Point((int)((double)x - (double)num1 / 2.0), (int)((double)y - (double)num1 / 2.0)), new Point((int)((double)x + (double)num1 / 2.0), (int)((double)y - (double)num1 / 2.0)) }; Pad.Graphics.DrawPolygon(new Pen(Color.Black), points3); Pad.Graphics.DrawRectangle(new Pen(Color.Black), (float)x - num1 / 4f, (float)y - num1, num1 / 2f, (float)((double)num1 / 2.0 + 1.0)); Pad.Graphics.FillPolygon((Brush)new SolidBrush(color3), points3); Pad.Graphics.FillRectangle((Brush)new SolidBrush(color3), (float)x - num1 / 4f, (float)y - num1, num1 / 2f, (float)((double)num1 / 2.0 + 1.0)); break; } if (!this.textEnabled) return; int num2 = (int)Pad.Graphics.MeasureString(str, font).Width; int num3 = (int)Pad.Graphics.MeasureString(str, font).Height; switch (this.Side) { case Side.Buy: Pad.Graphics.DrawString(str, font, (Brush)new SolidBrush(Color.Black), (float)(x - num2 / 2), (float)((double)y + (double)num1 + 2.0)); break; case Side.Sell: Pad.Graphics.DrawString(str, font, (Brush)new SolidBrush(Color.Black), (float)(x - num2 / 2), (float)((double)y - (double)num1 - 2.0) - (float)num3); break; case Side.SellShort: Pad.Graphics.DrawString(str, font, (Brush)new SolidBrush(Color.Black), (float)(x - num2 / 2), (float)((double)y + (double)num1 + 2.0)); break; } }
public void PaintAxes(Graphics g, Pad Pad, int Left, int Top, int H) { Graphics graphics = Pad.Graphics; int x1 = Pad.X1; int x2 = Pad.X2; int y1 = Pad.Y1; int y2 = Pad.Y2; Pad.Graphics = g; Pad.X1 = Left; Pad.X2 = Left + H; Pad.Y1 = Top; Pad.Y2 = Top + H; this.PaintAxes(Pad, Left, Top, H); Pad.Graphics = graphics; Pad.X1 = x1; Pad.X2 = x2; Pad.Y1 = y1; Pad.Y2 = y2; }
public void CalculateAxes(Pad Pad, int Left, int Top, int H) { this.left = Left; this.top = Top; this.h = H; this.mWHorsKIXa = new TVec3((double)(Left + H / 2), (double)(Top + 3 * H / 4), 0.0); if (this.ScaleZ < 1.0) this.mWHorsKIXa.y -= (1.0 - this.ScaleZ) * 0.25 * (double)H; double num = 0.7 * (double)H; double Z = 0.5 * this.ScaleZ * (double)H; this.lx = new TVec3(num, 0.0, 0.0); this.ly = new TVec3(0.0, num, 0.0); this.lz = new TVec3(0.0, 0.0, Z); this.lx = this.E6Oo4awtTa * this.Lx; this.ly = this.E6Oo4awtTa * this.Ly; this.lz = this.E6Oo4awtTa * this.Lz; }
public PadRange GetPadRangeX(Pad pad) { return null; }
public void Remove(Pad pad) { this.pads.Remove(pad); }
public int Add(Pad pad) { return this.pads.Add(pad); }
public void Paint(Pad pad, double MinX, double MaxX, double MinY, double MaxY) { Pen pen1 = new Pen(this.askColor); Pen pen2 = new Pen(this.bidColor); int num1 = 0; double num2 = 0.0; double num3 = 0.0; double num4 = 0.0; int x1_1 = 0; int x2_1 = 0; int y1_1 = 0; int y2_1 = 0; int y1_2 = 0; int y2_2 = 0; int num5 = 0; int num6 = 0; int num7 = 0; int num8 = 0; int num9 = 0; int num10 = 0; DateTime datetime1 = new DateTime((long)MinX); DateTime datetime2 = new DateTime((long)MaxX); int num11 = !(datetime1 < this.FirstDateTime) ? this.GetIndex(datetime1) : 0; int num12 = !(datetime2 > this.LastDateTime) ? this.GetIndex(datetime2) : this.Count - 1; if (num11 < 0 || num12 < 0) return; for (int index = num11; index <= num12; ++index) { Quote quote = this[index]; double num13 = (double)quote.DateTime.Ticks; double ask = quote.Ask; double bid = quote.Bid; if (num1 != 0) { int x1_2 = pad.ClientX(num2); y1_1 = pad.ClientY(num3); int x2_2 = pad.ClientX(num13); y2_1 = pad.ClientY(ask); if (ask != 0.0 && num3 != 0.0 && (pad.IsInRange(num13, ask) || pad.IsInRange(num2, num3)) && (x1_2 != num5 || x2_2 != num6 || (y1_1 != num7 || y2_1 != num8))) pad.Graphics.DrawLine(pen1, x1_2, y1_1, x2_2, y2_1); x1_1 = pad.ClientX(num2); y1_2 = pad.ClientY(num4); x2_1 = pad.ClientX(num13); y2_2 = pad.ClientY(bid); if (bid != 0.0 && num4 != 0.0 && (pad.IsInRange(num13, bid) || pad.IsInRange(num2, num4)) && (x1_1 != num5 || x2_1 != num6 || (y1_2 != num9 || y2_2 != num10))) pad.Graphics.DrawLine(pen2, x1_1, y1_2, x2_1, y2_2); } num7 = y1_1; num8 = y2_1; num3 = ask; num5 = x1_1; num9 = y1_2; num6 = x2_1; num10 = y2_2; num2 = num13; num4 = bid; ++num1; } }
public PadRange GetPadRangeY(Pad pad) { if (this.Count == 0) return new PadRange(0.0, 0.0); double min = double.MaxValue; double max = double.MinValue; DateTime datetime1 = new DateTime((long)pad.XMin); DateTime datetime2 = new DateTime((long)pad.XMax); int num1 = !(datetime1 <= this.FirstDateTime) ? this.GetIndex(datetime1) : 0; if (num1 == -1) return new PadRange(0.0, 0.0); int num2 = !(datetime2 >= this.LastDateTime) ? this.GetIndex(datetime2) : this.Count - 1; for (int index = num1; index <= num2; ++index) { Quote quote = this[index]; if (Math.Max(quote.Bid, quote.Ask) > max) max = Math.Max(quote.Bid, quote.Ask); if (Math.Min(quote.Bid, quote.Ask) < min && quote.Bid != 0.0 && quote.Ask != 0.0) min = Math.Min(quote.Bid, quote.Ask); } return new PadRange(min, max); }
public void Paint(Pad pad, double MinX, double MaxX, double MinY, double MaxY) { if (((NewOrderSingle) this.order).OrdType == OrdType.TrailingStop || ((NewOrderSingle) this.order).OrdType == OrdType.TrailingStopLimit) return; DateTime now = Clock.Now; Color color1 = Color.Green; Pen pen1 = this.order.OrdStatus == OrdStatus.Cancelled || this.order.OrdStatus == OrdStatus.Rejected ? new Pen(this.limitCancelColor, 2f) : new Pen(this.limitColor, 2f); pen1.DashStyle = DashStyle.Dash; Pen pen2 = this.order.OrdStatus == OrdStatus.Cancelled || this.order.OrdStatus == OrdStatus.Rejected ? new Pen(this.stopCancelColor, 2f) : new Pen(this.stopColor, 2f); pen2.DashStyle = DashStyle.Dash; switch (this.order.OrdStatus) { case OrdStatus.Filled: color1 = Color.Green; break; case OrdStatus.Cancelled: case OrdStatus.Rejected: color1 = Color.Gray; break; case OrdStatus.Stopped: color1 = Color.Red; break; } DateTime dateTime1 = new DateTime(1, 1, 1); DateTime dateTime2 = new DateTime(1, 1, 1); DateTime dateTime3 = new DateTime(1, 1, 1); DateTime dateTime4 = new DateTime(1, 1, 1); float num1 = 12f; DateTime dateTime5 = DateTime.MaxValue; if (this.order.OrdStatus == OrdStatus.Cancelled || this.order.OrdStatus == OrdStatus.Rejected || (this.order.OrdStatus == OrdStatus.PendingNew || this.order.OrdStatus == OrdStatus.Filled)) dateTime5 = this.order.Reports[this.order.Reports.Count - 1].TransactTime; if (((NewOrderSingle) this.order).OrdType == OrdType.Stop || ((NewOrderSingle) this.order).OrdType == OrdType.StopLimit) { dateTime1 = this.order.Reports[0].TransactTime; dateTime2 = this.order.OrdStatus != OrdStatus.PendingNew ? new DateTime(Math.Min(now.Ticks, dateTime5.Ticks)) : new DateTime(Math.Min(now.Ticks, (long) MaxX)); if ((double) dateTime1.Ticks > MaxX || (double) dateTime2.Ticks <= MinX) return; float num2 = (float) pad.ClientY(((FIXNewOrderSingle) this.order).StopPx); float x1 = (float) pad.ClientX((double) dateTime1.Ticks); float x2 = (float) pad.ClientX((double) dateTime2.Ticks); pad.Graphics.DrawLine(pen2, x1, num2, x2, num2); string priceDisplay = this.order.Instrument.PriceDisplay; string str = this.order.OrdStatus != OrdStatus.Filled ? (this.order.OrdStatus != OrdStatus.Cancelled ? (this.order.OrdStatus != OrdStatus.Rejected ? ((object) ((NewOrderSingle) this.order).Side).ToString() + " Stop at " + ((FIXNewOrderSingle) this.order).StopPx.ToString(priceDisplay) + " (Pending)" : ((object) ((NewOrderSingle) this.order).Side).ToString() + " Stop at " + ((FIXNewOrderSingle) this.order).StopPx.ToString(priceDisplay) + " (Rejected)") : ((object) ((NewOrderSingle) this.order).Side).ToString() + " Stop at " + ((FIXNewOrderSingle) this.order).StopPx.ToString(priceDisplay) + " (Canceled)") : ((object) ((NewOrderSingle) this.order).Side).ToString() + " Stop at " + ((FIXNewOrderSingle) this.order).StopPx.ToString(priceDisplay) + " (Executed)"; Font font = new Font("Arial", 8); double num3 = ((NewOrderSingle) this.order).Side != Side.Buy ? (double) num2 + 2.0 : (double) num2 - 2.0 - (double) (int) pad.Graphics.MeasureString(str, font).Height; double num4 = (double) x2 - (double) (int) pad.Graphics.MeasureString(str, font).Width - 2.0; pad.Graphics.DrawString(str, font, Brushes.Black, (float) num4, (float) num3); } if (((NewOrderSingle) this.order).OrdType == OrdType.Limit || ((NewOrderSingle) this.order).OrdType == OrdType.StopLimit) { dateTime3 = this.order.Reports[0].TransactTime; dateTime4 = this.order.OrdStatus != OrdStatus.New ? new DateTime(Math.Min(now.Ticks, dateTime5.Ticks)) : new DateTime(Math.Min(now.Ticks, (long) MaxX)); if ((double) dateTime3.Ticks > MaxX || (double) dateTime4.Ticks <= MinX) return; float num2 = (float) pad.ClientY(((FIXNewOrderSingle) this.order).Price); float x1 = (float) pad.ClientX((double) dateTime3.Ticks); float x2 = (float) pad.ClientX((double) dateTime4.Ticks); pad.Graphics.DrawLine(pen1, x1, num2, x2, num2); string priceDisplay = this.order.Instrument.PriceDisplay; string str; if (this.order.OrdStatus == OrdStatus.Filled) str = ((object) ((NewOrderSingle) this.order).Side).ToString() + " Limit at " + ((FIXNewOrderSingle) this.order).Price.ToString(priceDisplay) + " (Executed)"; else if (this.order.OrdStatus == OrdStatus.Cancelled) str = ((object) ((NewOrderSingle) this.order).Side).ToString() + " Limit at " + ((FIXNewOrderSingle) this.order).Price.ToString(priceDisplay) + " (Canceled)"; else if (this.order.OrdStatus == OrdStatus.Rejected) { str = ((object) ((NewOrderSingle) this.order).Side).ToString() + " Limit at " + ((FIXNewOrderSingle) this.order).Price.ToString(priceDisplay) + " (Rejected)"; } else { bool flag = false; if (((NewOrderSingle) this.order).OrdType == OrdType.StopLimit) { for (int index = 0; index < this.order.Reports.Count; ++index) { if (this.order.Reports[index].OrdStatus == OrdStatus.PendingNew) { flag = true; break; } } } str = flag || ((NewOrderSingle) this.order).OrdType == OrdType.Limit ? ((object) ((NewOrderSingle) this.order).Side).ToString() + " Limit at " + ((FIXNewOrderSingle) this.order).Price.ToString(priceDisplay) + " (Pending)" : ((object) ((NewOrderSingle) this.order).Side).ToString() + " Limit at " + ((FIXNewOrderSingle) this.order).Price.ToString(priceDisplay) + " (New)"; } Font font = new Font("Arial", 8f); double num3 = ((NewOrderSingle) this.order).Side == Side.Buy ? (double) num2 + 2.0 : (double) num2 - 2.0 - (double) (int) pad.Graphics.MeasureString(str, font).Height; double num4 = (double) x2 - (double) (int) pad.Graphics.MeasureString(str, font).Width - 2.0; pad.Graphics.DrawString(str, font, Brushes.Black, (float) num4, (float) num3); } if (this.order.OrdStatus != OrdStatus.Filled) return; double avgPx = this.order.AvgPx; int y = pad.ClientY(avgPx); int x = pad.ClientX((double) dateTime5.Ticks); if (!this.drawArrow) return; switch (((NewOrderSingle) this.order).Side) { case Side.Buy: Color color2 = this.buyColor; Point point1 = new Point(x, y); Point point2 = new Point((int) ((double) x - (double) num1 / 2.0), (int) ((double) y + (double) num1 / 2.0)); Point point3 = new Point((int) ((double) x + (double) num1 / 2.0), (int) ((double) y + (double) num1 / 2.0)); Point point4 = new Point((int) ((double) x - (double) num1 / 4.0), (int) ((double) y + (double) num1 / 2.0)); Point point5 = new Point((int) ((double) x + (double) num1 / 4.0), (int) ((double) y + (double) num1 / 2.0)); Point point6 = new Point((int) ((double) x - (double) num1 / 4.0), (int) ((double) y + (double) num1)); Point point7 = new Point((int) ((double) x + (double) num1 / 4.0), (int) ((double) y + (double) num1)); pad.Graphics.DrawPolygon(new Pen(color2), new Point[7] { point1, point3, point5, point7, point6, point4, point2 }); break; case Side.Sell: Color color3 = this.sellColor; Point point8 = new Point(x, y); Point point9 = new Point((int) ((double) x - (double) num1 / 2.0), (int) ((double) y - (double) num1 / 2.0)); Point point10 = new Point((int) ((double) x + (double) num1 / 2.0), (int) ((double) y - (double) num1 / 2.0)); Point point11 = new Point((int) ((double) x - (double) num1 / 4.0), (int) ((double) y - (double) num1 / 2.0)); Point point12 = new Point((int) ((double) x + (double) num1 / 4.0), (int) ((double) y - (double) num1 / 2.0)); Point point13 = new Point((int) ((double) x - (double) num1 / 4.0), (int) ((double) y - (double) num1)); Point point14 = new Point((int) ((double) x + (double) num1 / 4.0), (int) ((double) y - (double) num1)); pad.Graphics.DrawPolygon(new Pen(color3), new Point[7] { point8, point10, point12, point14, point13, point11, point9 }); break; case Side.SellShort: Color color4 = this.sellShortColor; Point point15 = new Point(x, y); Point point16 = new Point((int) ((double) x - (double) num1 / 2.0), (int) ((double) y - (double) num1 / 2.0)); Point point17 = new Point((int) ((double) x + (double) num1 / 2.0), (int) ((double) y - (double) num1 / 2.0)); Point point18 = new Point((int) ((double) x - (double) num1 / 4.0), (int) ((double) y - (double) num1 / 2.0)); Point point19 = new Point((int) ((double) x + (double) num1 / 4.0), (int) ((double) y - (double) num1 / 2.0)); Point point20 = new Point((int) ((double) x - (double) num1 / 4.0), (int) ((double) y - (double) num1)); Point point21 = new Point((int) ((double) x + (double) num1 / 4.0), (int) ((double) y - (double) num1)); pad.Graphics.DrawPolygon(new Pen(color4), new Point[7] { point15, point17, point19, point21, point20, point18, point16 }); break; } }
public PadRange GetPadRangeY(Pad pad) { DateTime now = Clock.Now; FIXExecutionReport fixExecutionReport1 = (FIXExecutionReport) null; if (this.order.Reports.Count != 0) fixExecutionReport1 = (FIXExecutionReport) this.order.Reports[this.order.Reports.Count - 1]; if (fixExecutionReport1 == null) return new PadRange(0.0, 0.0); if (((NewOrderSingle) this.order).OrdType == OrdType.Market && this.order.OrdStatus != OrdStatus.Filled) return new PadRange(0.0, 0.0); FIXExecutionReport fixExecutionReport2 = (FIXExecutionReport) this.order.Reports[0]; DateTime dateTime1 = new DateTime((long) pad.XMin); DateTime dateTime2 = new DateTime((long) pad.XMax); DateTime transactTime = fixExecutionReport2.TransactTime; DateTime dateTime3 = this.order.OrdStatus == OrdStatus.Filled || this.order.OrdStatus == OrdStatus.Cancelled || this.order.OrdStatus == OrdStatus.Rejected ? fixExecutionReport1.TransactTime : now; if (!(dateTime1 <= dateTime3) || !(dateTime2 >= transactTime) || (this.order.OrdStatus == OrdStatus.Cancelled || this.order.OrdStatus == OrdStatus.Rejected)) return new PadRange(0.0, 0.0); double val1 = this.order.AvgPx - 0.0 / 1.0; double val2 = this.order.AvgPx + 0.0 / 1.0; if (((NewOrderSingle) this.order).OrdType == OrdType.Limit) { int ClientY = pad.ClientY(((FIXNewOrderSingle) this.order).Price); if (((NewOrderSingle) this.order).Side == Side.Buy) { val2 = pad.WorldY(ClientY); val1 = ((FIXNewOrderSingle) this.order).Price; } else { val1 = pad.WorldY(ClientY); val2 = ((FIXNewOrderSingle) this.order).Price; } } if (((NewOrderSingle) this.order).OrdType == OrdType.Stop) { int ClientY = pad.ClientY(((FIXNewOrderSingle) this.order).StopPx); if (((NewOrderSingle) this.order).Side != Side.Buy) { val2 = pad.WorldY(ClientY); val1 = ((FIXNewOrderSingle) this.order).StopPx; } else { val1 = pad.WorldY(ClientY); val2 = ((FIXNewOrderSingle) this.order).StopPx; } } if (((NewOrderSingle) this.order).OrdType == OrdType.StopLimit) { int ClientY1 = pad.ClientY(((FIXNewOrderSingle) this.order).Price); int ClientY2 = pad.ClientY(((FIXNewOrderSingle) this.order).StopPx); if (((NewOrderSingle) this.order).Side == Side.Buy) { val2 = pad.WorldY(ClientY1); val1 = pad.WorldY(ClientY2); } else { val1 = pad.WorldY(ClientY1); val2 = pad.WorldY(ClientY2); } } return new PadRange(Math.Min(val1, val2), Math.Max(val1, val2)); }
public void Paint(Pad pad, double MinX, double MaxX, double MinY, double MaxY) { Pen pen = new Pen(this.color); int num1 = 0; double num2 = 0.0; double num3 = 0.0; int x1 = 0; int x2 = 0; int y1 = 0; int y2 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; DateTime datetime1 = new DateTime((long)MinX); DateTime datetime2 = new DateTime((long)MaxX); int num8 = !(datetime1 < this.FirstDateTime) ? this.GetIndex(datetime1) : 0; int num9 = !(datetime2 > this.LastDateTime) ? this.GetIndex(datetime2) : this.Count - 1; if (num8 < 0 || num9 < 0) return; for (int index = num8; index <= num9; ++index) { Trade trade = this[index]; double num10 = (double)trade.DateTime.Ticks; double price = trade.Price; if (num1 != 0 && price != 0.0 && num3 != 0.0) { x1 = pad.ClientX(num2); y1 = pad.ClientY(num3); x2 = pad.ClientX(num10); y2 = pad.ClientY(price); if ((pad.IsInRange(num10, price) || pad.IsInRange(num2, num3)) && (x1 != num4 || x2 != num5 || (y1 != num6 || y2 != num7))) pad.Graphics.DrawLine(pen, x1, y1, x2, y2); } num4 = x1; num6 = y1; num5 = x2; num7 = y2; num2 = num10; num3 = price; ++num1; } }
public PadRange GetPadRangeY(Pad pad) { if (this.Count == 0) return new PadRange(0.0, 0.0); double min = double.MaxValue; double max = double.MinValue; DateTime datetime1 = new DateTime((long)pad.XMin); DateTime datetime2 = new DateTime((long)pad.XMax); if (this.Count > 0) { int num1 = !(datetime1 <= this.FirstDateTime) ? this.GetIndex(datetime1) : 0; int num2 = !(datetime2 >= this.LastDateTime) ? this.GetIndex(datetime2) : this.Count - 1; if (num1 == -1) return new PadRange(0.0, 0.0); for (int index = num1; index < num2; ++index) { Trade trade = this[index]; if (trade.Price > max && trade.Price != 0.0) max = trade.Price; if (trade.Price < min && trade.Price != 0.0) min = trade.Price; } } return new PadRange(min, max); }
public int IndexOf(Pad pad) { return this.pads.IndexOf(pad); }
public static TView View(Pad pad) { if (pad.View3D == null) pad.View3D = new TView(); return (TView)pad.View3D; }
public virtual PadRange GetPadRangeX(Pad pad) { return null; }
private static void lF6ovwu8P3(Pad pad) { if (pad.Grid3D) { foreach (Axis axis in pad.Axes3D) axis.GridEnabled = true; } else { foreach (Axis axis in pad.Axes3D) axis.GridEnabled = false; } }
public virtual void Paint(Pad pad, double xMin, double xMax, double yMin, double yMax) { Pen pen1 = new Pen(this.Color, (float)this.DrawWidth); int num1 = 0; double num2 = 0.0; double num3 = 0.0; int x1 = 0; int x2 = 0; int y1 = 0; int y2 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; DateTime dateTime1 = new DateTime((long)xMin); DateTime dateTime2 = new DateTime((long)xMax); int index1 = this.GetIndex(dateTime1, EIndexOption.Next); int index2 = this.GetIndex(dateTime2, EIndexOption.Prev); if (index1 == -1 || index2 == -1) return; switch (this.fDrawStyle) { case EDrawStyle.Line: for (int index3 = index1; index3 <= index2; ++index3) { DateTime dateTime3 = this.GetDateTime(index3); double num8 = (double)dateTime3.Ticks; double num9 = base[index3, 0]; if (dateTime3 > this.splitDate) pen1 = new Pen(this.secondColor, (float)this.DrawWidth); if (num1 != 0) { x1 = pad.ClientX(num2); y1 = pad.ClientY(num3); x2 = pad.ClientX(num8); y2 = pad.ClientY(num9); if ((pad.IsInRange(num8, num9) || pad.IsInRange(num2, num3)) && (x1 != num4 || x2 != num5 || (y1 != num6 || y2 != num7))) pad.Graphics.DrawLine(pen1, x1, y1, x2, y2); } num4 = x1; num6 = y1; num5 = x2; num7 = y2; num2 = num8; num3 = num9; ++num1; } break; case EDrawStyle.Bar: for (int index3 = index1; index3 <= index2; ++index3) { DateTime dateTime3 = this.GetDateTime(index3); double WorldX = (double)dateTime3.Ticks; double WorldY = base[index3, 0]; if (dateTime3 > this.splitDate) { Pen pen2 = new Pen(this.secondColor, (float)this.fDrawWidth); } if (WorldY > 0.0) pad.Graphics.FillRectangle((Brush)new SolidBrush(this.fColor), pad.ClientX(WorldX) - (this.fDrawWidth + 1) / 2, pad.ClientY(WorldY), this.fDrawWidth + 1, pad.ClientY(0.0) - pad.ClientY(WorldY)); else pad.Graphics.FillRectangle((Brush)new SolidBrush(this.fColor), pad.ClientX(WorldX) - (this.fDrawWidth + 1) / 2, pad.ClientY(0.0), this.fDrawWidth + 1, pad.ClientY(WorldY) - pad.ClientY(0.0)); } break; case EDrawStyle.Circle: for (int index3 = index1; index3 <= index2; ++index3) { DateTime dateTime3 = this.GetDateTime(index3); double WorldX = (double)dateTime3.Ticks; double WorldY = base[index3, 0]; SolidBrush solidBrush = !(dateTime3 > this.splitDate) ? new SolidBrush(this.fColor) : new SolidBrush(this.secondColor); pad.Graphics.FillEllipse((Brush)solidBrush, pad.ClientX(WorldX) - this.fDrawWidth / 2, pad.ClientY(WorldY) - this.fDrawWidth / 2, this.fDrawWidth, this.fDrawWidth); } break; } }
public void PaintAxes(Pad Pad, int Left, int Top, int H) { this.CalculateAxes(Pad, Left, Top, H); TVec3[] v = new TVec3[4] { this.o - 0.5 * this.Lx - 0.5 * this.Ly, this.o + 0.5 * this.Lx - 0.5 * this.Ly, this.o + 0.5 * this.Lx + 0.5 * this.Ly, this.o - 0.5 * this.Lx + 0.5 * this.Ly }; double num1 = -1.0; int num2 = -1; for (int index = 0; index < v.Length; ++index) { if (v[index].y > num1) { num1 = v[index].y; num2 = index; } } int index1 = 0; int index2 = 0; int index3 = 0; switch (num2) { case 0: index1 = 1; index2 = 2; index3 = 3; break; case 1: index1 = 2; index2 = 3; index3 = 0; break; case 2: index1 = 3; index2 = 0; index3 = 1; break; case 3: index1 = 0; index2 = 1; index3 = 2; break; } Point[] points1 = TVec3.PointArray(v); Point[] points2 = new Point[4] { (Point)v[index1], (Point)v[index2], (Point)(v[index2] + this.Lz), (Point)(v[index1] + this.Lz) }; Point[] points3 = new Point[4] { (Point)v[index2], (Point)v[index3], (Point)(v[index3] + this.Lz), (Point)(v[index2] + this.Lz) }; Graphics graphics = Pad.Graphics; graphics.Clip = new Region(new Rectangle(Pad.X1, Pad.Y1, Pad.Width + 1, Pad.Height + 1)); Pen pen = new Pen(Color.Black, 1f); Brush brush = (Brush)new SolidBrush(Color.White); graphics.FillPolygon(brush, points1); graphics.FillPolygon(brush, points2); graphics.FillPolygon(brush, points3); graphics.DrawPolygon(pen, points1); graphics.DrawPolygon(pen, points2); graphics.DrawPolygon(pen, points3); TView.lF6ovwu8P3(Pad); Pad.AxisX3D.Position = EAxisPosition.Bottom; Pad.AxisY3D.Position = EAxisPosition.Bottom; Pad.AxisZ3D.Position = EAxisPosition.Right; this.PaintAxisGridAndTicks(graphics, Pad.AxisX3D, true, v[0], v[0] + this.Ly, this.Lx); this.PaintAxisGridAndTicks(graphics, Pad.AxisY3D, true, v[0], v[0] + this.Lx, this.Ly); this.PaintAxisGridAndTicks(graphics, Pad.AxisX3D, false, v[index2], v[index2] + this.Lz, this.Lx); this.PaintAxisGridAndTicks(graphics, Pad.AxisY3D, false, v[index2], v[index2] + this.Lz, this.Ly); this.PaintAxisGridAndTicks(graphics, Pad.AxisZ3D, true, v[index2], v[index2] + this.Lx, this.Lz); this.PaintAxisGridAndTicks(graphics, Pad.AxisZ3D, true, v[index2], v[index2] + this.Ly, this.Lz); }
public virtual void Paint(Pad Pad, double XMin, double XMax, double YMin, double YMax) { if (Pad.For3D) { int millisecond = DateTime.Now.Millisecond; int num1 = Pad.ClientX(XMin); int num2 = (Pad.ClientY(YMax) + Pad.Y1) / 2; int num3 = Math.Abs(Pad.ClientX(XMax) - Pad.ClientX(XMin)); int num4 = Math.Abs(Pad.ClientY(YMax) - Pad.ClientY(YMin)); int H = num3 < num4 ? num3 : num4; int Left = num1 + num3 / 2 - H / 2; int Top = num2; if (this.fShowMaxZ == 0.0) this.ShowUnnormalizedZ(); Pad.AxisZ3D.Min = 0.0; Pad.AxisZ3D.Max = this.fShowMaxZ; TView.View(Pad).PaintAxes(Pad, Left, Top, H); if (!this.Multicolor3D) { switch (this.Smoothing) { case ESmoothing.Disabled: this.kG6oz8rvGU.umVNE9P5cO(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMax); this.kG6oz8rvGU.Paint(Pad); break; case ESmoothing.Linear: this.U4Z3nPEiRp.umVNE9P5cO(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMax); this.U4Z3nPEiRp.Paint(Pad); break; } } else { switch (this.Smoothing) { case ESmoothing.Disabled: this.l303o6TYVf.uDx3gBDtTM(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMin, this.fBinMax, this.fPalette); this.l303o6TYVf.Paint(Pad); break; case ESmoothing.Linear: this.MUK33qPZeB.uDx3gBDtTM(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMin, this.fBinMax, this.fPalette); this.MUK33qPZeB.Paint(Pad); break; } } int num5 = DateTime.Now.Millisecond - millisecond; } else { int millisecond1 = DateTime.Now.Millisecond; int millisecond2 = DateTime.Now.Millisecond; int x = Pad.ClientX(this.fXMin); int y = Pad.ClientY(this.fYMax); int W = Pad.ClientX(this.fXMax) - x; int H = Pad.ClientY(this.fYMin) - y; int length = this.fPalette.Length; int[] numArray = new int[length]; for (int index = 0; index < length; ++index) numArray[index] = this.fPalette[index].ToArgb(); TPaintingBitmap tpaintingBitmap = new TPaintingBitmap(W, H); tpaintingBitmap.Fill(Pad.ForeColor); double num1 = (double) W / (double) this.fNBinsX; double num2 = (double) H / (double) this.fNBinsY; int w = (int) (num1 + 1.0); int h = (int) (num2 + 1.0); double num3 = (double) (this.fNColors - 1) / (this.fBinMax - this.fBinMin); int index1 = 0; double num4 = 0.0; while (index1 < this.fNBinsX) { int index2 = 0; double num5 = 0.0; while (index2 < this.fNBinsY) { if (this.fBins[index1, index2] != 0.0) { int index3 = (int) (num3 * (this.fBins[index1, index2] - this.fBinMin)); tpaintingBitmap.FillRectangle(numArray[index3], (int) num4, H - (int) num5 - h, w, h); } ++index2; num5 += num2; } ++index1; num4 += num1; } Bitmap bitmap = tpaintingBitmap.Get(); Pad.Graphics.DrawImage((Image) bitmap, x, y); int millisecond3 = DateTime.Now.Millisecond; int num6 = millisecond2 - millisecond1; int num7 = millisecond3 - millisecond1; } }
public virtual PadRange GetPadRangeY(Pad pad) { if (this.Count == 0) return new PadRange(0.0, 0.0); DateTime dt1 = new DateTime((long)pad.XMin); DateTime dt2 = new DateTime((long)pad.XMax); return new PadRange(this.GetMin(dt1, dt2), this.GetMax(dt1, dt2)); }
public virtual void Paint(Pad pad, double xMin, double xMax, double yMin, double yMax) { int x = pad.ClientX(this.X); int y = pad.ClientY(this.Y); pad.Graphics.DrawImage(this.image, x, y); }