Example #1
0
    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;
      }
    }
Example #2
0
		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;
			}
		}
Example #3
0
 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;
   }
 }
Example #4
0
		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);
		}
Example #5
0
		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);
		}
Example #6
0
		public void Paint(Pad pad, double minX, double maxX, double minY, double maxY)
		{
			double WorldY = this.fStatus != StopStatus.Executed ? Math.Abs(this.fStopPrice) : Math.Abs(this.fFillPrice);
			if (this.fType == StopType.Time)
				WorldY = this.fStopPrice;
			int num1 = pad.ClientX(this.fCreationTime.Ticks);
			int num2 = pad.ClientY(WorldY);
			string str = WorldY.ToString(this.fInstrument.PriceDisplay) + this.fStatus.ToString();
			Font font = new Font("Arial", 8f);
			Color color = this.canceledColor;
			switch (this.fStatus)
			{
				case StopStatus.Active:
					color = this.activeColor;
					break;
				case StopStatus.Executed:
					color = this.executedColor;
					break;
				case StopStatus.Canceled:
					color = this.canceledColor;
					break;
			}
			Pen pen = new Pen(color, 2f);
			pen.DashStyle = DashStyle.Dash;
//			double val2 = (double)pad.ClientX(Clock.Now.Ticks);
			double val2 = pad.ClientX(DateTime.Now.Ticks);
			double val1_1 = pad.ClientX(minX);
			double val1_2 = pad.ClientX(maxX);
			if (this.fStatus != StopStatus.Active)
				val2 = pad.ClientX(this.fCompletionTime.Ticks);
			float x1 = (float)Math.Max(val1_1, num1);
			float x2 = (float)Math.Min(val1_2, val2);
			if ((double)x1 > (double)x2)
				return;
			pad.Graphics.DrawLine(pen, x1, (float)num2, x2, (float)num2);
			if (!this.textEnabled)
				return;
			double num3 = num1 + 2;
			double num4 = this.fSide != PositionSide.Long ? (double)(num2 + 2) : (double)(num2 - 2 - (int)pad.Graphics.MeasureString(str, font).Height);
			pad.Graphics.DrawString(str, font, Brushes.Black, (float)num3, (float)num4);
		}
Example #7
0
		public override void Paint(Pad pad, double xMin, double xMax, double yMin, double yMax)
		{
			Pen pen = new Pen(this.Color, this.fDrawWidth);
			Brush brush = new SolidBrush(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)xMin);
			DateTime dateTime2 = new DateTime((long)xMax);
			int num8 = !(dateTime1 < this.FirstDateTime) ? this.GetIndex(dateTime1, EIndexOption.Next) : this.fFirstIndex;
			int num9 = !(dateTime2 > this.LastDateTime) ? this.GetIndex(dateTime2, EIndexOption.Prev) : this.fLastIndex;
			if (num8 == -1 || num9 == -1)
				return;
			switch (this.fDrawStyle)
			{
				case EDrawStyle.Line:
					for (int index = num8; index <= num9; ++index)
					{
						double num10 = (double)this.GetDateTime(index).Ticks;
						double num11 = ((TimeSeries)this)[index, 0];
						if (num1 != 0)
						{
							x1 = pad.ClientX(num2);
							y1 = pad.ClientY(num3);
							x2 = pad.ClientX(num10);
							y2 = pad.ClientY(num11);
							if ((pad.IsInRange(num10, num11) || 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 = num11;
						++num1;
					}
					break;
				case EDrawStyle.Bar:
					for (int index = num8; index <= num9; ++index)
					{
						double WorldX = (double)this.GetDateTime(index).Ticks;
						double WorldY = ((TimeSeries)this)[index, 0];
						if (WorldY > 0.0)
							pad.Graphics.FillRectangle((Brush)new SolidBrush(this.Color), pad.ClientX(WorldX) - this.fDrawWidth / 2, pad.ClientY(WorldY), this.fDrawWidth, pad.ClientY(0.0) - pad.ClientY(WorldY));
						else
							pad.Graphics.FillRectangle((Brush)new SolidBrush(this.Color), pad.ClientX(WorldX) - this.fDrawWidth / 2, pad.ClientY(0.0), this.fDrawWidth, pad.ClientY(WorldY) - pad.ClientY(0.0));
					}
					break;
				case EDrawStyle.Circle:
					for (int index = num8; index <= num9; ++index)
					{
						double WorldX = (double)this.GetDateTime(index).Ticks;
						double WorldY = ((TimeSeries)this)[index, 0];
						pad.Graphics.FillEllipse(brush, pad.ClientX(WorldX) - this.fDrawWidth / 2, pad.ClientY(WorldY) - this.fDrawWidth / 2, this.fDrawWidth, this.fDrawWidth);
					}
					break;
			}
		}
Example #8
0
		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;
			}
		}
Example #9
0
 public virtual void Paint(Pad Pad, double XMin, double XMax, double YMin, double YMax)
 {
   int num1 = Pad.ClientX(this.fX);
   int y = Pad.ClientY(this.fY);
   float num2 = (float) this.fSize;
   switch (this.fStyle)
   {
     case EMarkerStyle.Rectangle:
       if (this.fFilled)
       {
         Pad.Graphics.FillRectangle((Brush) new SolidBrush(this.fColor), (float) num1 - num2 / 2f, (float) y - num2 / 2f, num2, num2);
         break;
       }
       else
       {
         Pen pen = new Pen(this.fColor);
         Pad.Graphics.DrawRectangle(pen, (float) num1 - num2 / 2f, (float) y - num2 / 2f, num2, num2);
         break;
       }
     case EMarkerStyle.Triangle:
       float num3 = (float) ((double) num2 / 2.0 * Math.Tan(Math.PI / 6.0));
       float num4 = num2 * (float) Math.Cos(Math.PI / 6.0) - num3;
       PointF pointF1 = new PointF((float) num1, (float) y - num4);
       PointF pointF2 = new PointF((float) num1 - num2 / 2f, (float) y + num3);
       PointF pointF3 = new PointF((float) num1 + num2 / 2f, (float) y + num3);
       PointF[] points1 = new PointF[4]
       {
         pointF1,
         pointF2,
         pointF3,
         pointF1
       };
       if (this.fFilled)
       {
         Pad.Graphics.FillPolygon((Brush) new SolidBrush(this.fColor), points1);
         break;
       }
       else
       {
         Pen pen = new Pen(this.fColor);
         Pad.Graphics.DrawLines(pen, points1);
         break;
       }
     case EMarkerStyle.Circle:
       if (this.fFilled)
       {
         Pad.Graphics.FillEllipse((Brush) new SolidBrush(this.fColor), (float) num1 - num2 / 2f, (float) y - num2 / 2f, num2, num2);
         break;
       }
       else
       {
         Pen pen = new Pen(this.fColor);
         Pad.Graphics.DrawEllipse(pen, (float) num1 - num2 / 2f, (float) y - num2 / 2f, num2, num2);
         break;
       }
     case EMarkerStyle.Bar:
       Pen pen1 = new Pen(this.fColor);
       Pad.Graphics.DrawLine(pen1, num1, Pad.ClientY(this.fLow), Pad.ClientX(this.fX), Pad.ClientY(this.fHigh));
       Pad.Graphics.DrawLine(pen1, num1, Pad.ClientY(this.fLow), Pad.ClientX(this.fX) - 3, Pad.ClientY(this.fLow));
       Pad.Graphics.DrawLine(pen1, num1, Pad.ClientY(this.fHigh), Pad.ClientX(this.fX) + 3, Pad.ClientY(this.fHigh));
       break;
     case EMarkerStyle.Buy:
       PointF[] points2 = new PointF[3]
       {
         (PointF) new Point(num1, y),
         (PointF) new Point((int) ((double) num1 - (double) num2 / 2.0), (int) ((double) y + (double) num2)),
         (PointF) new Point((int) ((double) num1 + (double) num2 / 2.0), (int) ((double) y + (double) num2))
       };
       Pad.Graphics.FillPolygon((Brush) new SolidBrush(this.fBuyColor), points2);
       break;
     case EMarkerStyle.Sell:
       Point[] points3 = new Point[3]
       {
         new Point(num1, y),
         new Point((int) ((double) num1 - (double) num2 / 2.0), (int) ((double) y - (double) num2)),
         new Point((int) ((double) num1 + (double) num2 / 2.0), (int) ((double) y - (double) num2))
       };
       Pad.Graphics.FillPolygon((Brush) new SolidBrush(this.fSellColor), points3);
       break;
     case EMarkerStyle.SellShort:
       Point[] points4 = new Point[3]
       {
         new Point(num1, y),
         new Point((int) ((double) num1 - (double) num2 / 2.0), (int) ((double) y - (double) num2)),
         new Point((int) ((double) num1 + (double) num2 / 2.0), (int) ((double) y - (double) num2))
       };
       Pad.Graphics.FillPolygon((Brush) new SolidBrush(this.fSellShortColor), points4);
       break;
     case EMarkerStyle.BuyShort:
       Point[] points5 = new Point[3]
       {
         new Point(num1, y),
         new Point((int) ((double) num1 - (double) num2 / 2.0), (int) ((double) y + (double) num2)),
         new Point((int) ((double) num1 + (double) num2 / 2.0), (int) ((double) y + (double) num2))
       };
       Pad.Graphics.FillPolygon((Brush) new SolidBrush(this.fBuyShortColor), points5);
       break;
     case EMarkerStyle.Plus:
       Pen pen2 = new Pen(this.fColor);
       Pad.Graphics.DrawLine(pen2, (float) num1 - num2 / 2f, (float) y, (float) num1 + num2 / 2f, (float) y);
       Pad.Graphics.DrawLine(pen2, (float) num1, (float) y - num2 / 2f, (float) num1, (float) y + num2 / 2f);
       break;
     case EMarkerStyle.Cross:
       Pen pen3 = new Pen(this.fColor);
       Pad.Graphics.DrawLine(pen3, (float) num1 - num2 / 2f, (float) y - num2 / 2f, (float) num1 + num2 / 2f, (float) y + num2 / 2f);
       Pad.Graphics.DrawLine(pen3, (float) num1 - num2 / 2f, (float) y + num2 / 2f, (float) num1 + num2 / 2f, (float) y - num2 / 2f);
       break;
   }
   if (!this.fTextEnabled || this.fText == null || !(this.fText != ""))
     return;
   int num5 = (int) Pad.Graphics.MeasureString(this.fText, this.fTextFont).Width;
   int num6 = (int) Pad.Graphics.MeasureString(this.fText, this.fTextFont).Height;
   switch (this.fStyle)
   {
     case EMarkerStyle.Buy:
       Pad.Graphics.DrawString(this.fText, this.fTextFont, (Brush) new SolidBrush(this.fTextColor), (float) (Pad.ClientX(this.fX) - num5 / 2), (float) Pad.ClientY(this.fY) + num2 + (float) this.fTextOffset);
       break;
     case EMarkerStyle.Sell:
       Pad.Graphics.DrawString(this.fText, this.fTextFont, (Brush) new SolidBrush(this.fTextColor), (float) (Pad.ClientX(this.fX) - num5 / 2), (float) Pad.ClientY(this.fY) - num2 - (float) this.fTextOffset - (float) num6);
       break;
     case EMarkerStyle.SellShort:
       Pad.Graphics.DrawString(this.fText, this.fTextFont, (Brush) new SolidBrush(this.fTextColor), (float) (Pad.ClientX(this.fX) - num5 / 2), (float) Pad.ClientY(this.fY) + num2 + (float) this.fTextOffset);
       break;
     case EMarkerStyle.BuyShort:
       Pad.Graphics.DrawString(this.fText, this.fTextFont, (Brush) new SolidBrush(this.fTextColor), (float) (Pad.ClientX(this.fX) - num5 / 2), (float) Pad.ClientY(this.fY) + num2 + (float) this.fTextOffset);
       break;
   }
 }
Example #10
0
		public virtual void Paint(Pad Pad, double MinX, double MaxX, double MinY, double MaxY)
		{
			float height = this.qUZomVYuoh(Pad);
			float width = this.MhmouvgBhg(Pad);
			float x = 0.0f;
			float y = 0.0f;
			switch (this.Position)
			{
				case ETextBoxPosition.TopRight:
					x = (float)(Pad.ClientX() + Pad.ClientWidth() - this.X) - width;
					y = (float)(Pad.ClientY() + this.X);
					break;
				case ETextBoxPosition.TopLeft:
					x = (float)(Pad.ClientX() + this.X);
					y = (float)(Pad.ClientY() + this.Y);
					break;
				case ETextBoxPosition.BottomRight:
					x = (float)(Pad.ClientX() + Pad.ClientWidth() - this.X) - width;
					y = (float)(Pad.ClientY() + Pad.ClientHeight() - this.Y) - height;
					break;
				case ETextBoxPosition.BottomLeft:
					x = (float)(Pad.ClientX() + this.X);
					y = (float)(Pad.ClientY() + Pad.ClientHeight() - this.Y) - height;
					break;
			}
			Pad.Graphics.FillRectangle(new SolidBrush(this.BackColor), x, y, width, height);
			if (this.BorderEnabled)
				Pad.Graphics.DrawRectangle(new Pen(this.BorderColor), x, y, width, height);
			foreach (TTextBoxItem ttextBoxItem in this.items)
			{
				int num = (int)Pad.Graphics.MeasureString(ttextBoxItem.Text, ttextBoxItem.Font).Height;
				Pad.Graphics.DrawString(ttextBoxItem.Text, ttextBoxItem.Font, new SolidBrush(ttextBoxItem.Color), x + 5f, y);
				y += (float)(2 + num);
			}
		}
Example #11
0
		public override void Paint(Pad pad, double XMin, double XMax, double YMin, double YMax)
		{
			Pen pen1 = new Pen(this.Color);
			Pen pen2 = new Pen(this.Color);
			Pen pen3 = new Pen(this.CandleColor);
			Pen pen4 = new Pen(this.CandleBorderColor);
			Brush brush1 = new SolidBrush(this.CandleWhiteColor);
			Brush brush2 = new SolidBrush(this.CandleBlackColor);
			int num1 = 0;
			double num2 = 0.0;
			double num3 = 0.0;
			int num4 = 0;
			int num5 = 0;
			int num6 = 0;
			int x2 = 0;
			long num7 = 0L;
			long num8 = 0L;
			int num9 = 0;
			int num10 = 0;
			DateTime dateTime1 = new DateTime((long)XMin);
			DateTime dateTime2 = new DateTime((long)XMax);
			int num11 = !(dateTime1 < this.FirstDateTime) ? this.GetIndex(dateTime1, EIndexOption.Prev) : 0;
			int num12 = !(dateTime2 > this.LastDateTime) ? this.GetIndex(dateTime2, EIndexOption.Next) : this.Count - 1;
			if (num11 == -1 || num12 == -1)
				return;
			for (int i = num11; i <= num12; ++i)
			{
				Bar bar = this[i];
				long num13 = bar.BeginTime.Ticks;
				long num14 = bar.EndTime.Ticks;
				double num15 = (double)(num13 + (num14 - num13) / 2L);
				int num16 = pad.ClientX(num15);
				double high = bar.High;
				double low = bar.Low;
				double open = bar.Open;
				double close = bar.Close;
				Pen pen5 = pen2;
				if (bar.Color != Color.Empty)
					pen5 = new Pen(bar.Color);
				switch (this.ChartStyle)
				{
					case ChartStyle.Line:
						double num17 = close;
						if (num1 != 0)
						{
							num13 = (long)pad.ClientX(num2);
							num4 = pad.ClientY(num3);
							num14 = (long)pad.ClientX(num15);
							num5 = pad.ClientY(num17);
							if ((pad.IsInRange(num15, num17) || pad.IsInRange(num2, num3)) && (num13 != num7 || num14 != num8 || (num4 != num9 || num5 != num10)))
								pad.Graphics.DrawLine(pen1, (float)num13, (float)num4, (float)num14, (float)num5);
						}
						num7 = num13;
						num9 = num4;
						num8 = num14;
						num10 = num5;
						num2 = num15;
						num3 = num17;
						++num1;
						break;
					case ChartStyle.Bar:
						switch (this.BarWidthStyle)
						{
							case EWidthStyle.Pixel:
								num6 = pad.ClientX(num15) - this.BarWidth / 2;
								x2 = pad.ClientX(num15) + this.BarWidth / 2;
								break;
							case EWidthStyle.DateTime:
								num6 = pad.ClientX(num15 - (double)((long)this.BarWidth * 10000000L / 2L));
								x2 = pad.ClientX(num15 + (double)((long)this.BarWidth * 10000000L / 2L));
								break;
							case EWidthStyle.Auto:
								num6 = pad.ClientX((double)num13);
								x2 = pad.ClientX((double)num14);
								break;
						}
						pad.Graphics.DrawLine(pen5, num16, pad.ClientY(low), num16, pad.ClientY(high));
						if (open != 0.0)
							pad.Graphics.DrawLine(pen5, num16, pad.ClientY(open), num6, pad.ClientY(open));
						if (close != 0.0)
						{
							pad.Graphics.DrawLine(pen5, num16, pad.ClientY(close), x2, pad.ClientY(close));
							break;
						}
						else
							break;
					case ChartStyle.Candle:
						switch (this.CandleWidthStyle)
						{
							case EWidthStyle.Pixel:
								num6 = pad.ClientX(num15) - this.CandleWidth / 2;
								x2 = pad.ClientX(num15) + this.CandleWidth / 2;
								break;
							case EWidthStyle.DateTime:
								num6 = pad.ClientX(num15 - (double)((long)this.CandleWidth * 10000000L / 2L));
								x2 = pad.ClientX(num15 + (double)((long)this.CandleWidth * 10000000L / 2L));
								break;
							case EWidthStyle.Auto:
								num6 = pad.ClientX((double)num13);
								x2 = pad.ClientX((double)num14);
								break;
						}
						pad.Graphics.DrawLine(pen3, num16, pad.ClientY(low), num16, pad.ClientY(high));
						if (open != 0.0 && close != 0.0)
						{
							if (open > close)
							{
								int width = x2 - num6;
								int height = pad.ClientY(close) - pad.ClientY(open);
								if (height == 0)
									height = 1;
								pad.Graphics.FillRectangle(brush2, num6, pad.ClientY(open), width, height);
								break;
							}
							else
							{
								int width = x2 - num6;
								int height = pad.ClientY(open) - pad.ClientY(close);
								if (height == 0)
									height = 1;
								if (pad.ForeColor == this.CandleWhiteColor)
								{
									pad.Graphics.DrawRectangle(pen4, num6, pad.ClientY(close), width, height);
									pad.Graphics.FillRectangle(brush1, num6 + 1, pad.ClientY(close) + 1, width - 2, height - 1);
									break;
								}
								else
								{
									pad.Graphics.FillRectangle(brush1, num6, pad.ClientY(close), width, height);
									break;
								}
							}
						}
						else
							break;
				}
			}
		}
Example #12
0
		public void Paint(Pad Pad, double MinX, double MaxX, double MinY, double MaxY)
		{
			double WorldY = this.J3YAFHAWt0;
			int num1 = Pad.ClientX((double)this.CreationTime.Ticks);
			int num2 = Pad.ClientY(WorldY);
			string str = WorldY.ToString() + this.Status.ToString();
			Font font = new Font("Arial", 8f);
			Color color = this.YCKA0R33mr;
			switch (this.Status)
			{
				case TriggerStatus.Active:
					color = this.pEXA4yCenN;
					break;
				case TriggerStatus.Executed:
					color = this.pZXAJFXyGb;
					break;
			}
			Pen pen = new Pen(color, 1f);
			pen.DashStyle = DashStyle.DashDot;
			double val2 = (double)Pad.ClientX((double)Clock.Now.Ticks);
			double val1_1 = (double)Pad.ClientX(MinX);
			double val1_2 = (double)Pad.ClientX(MaxX);
			if (this.Status != TriggerStatus.Active)
				val2 = (double)Pad.ClientX((double)this.CompletionTime.Ticks);
			float x1 = (float)Math.Max(val1_1, (double)num1);
			float x2 = (float)Math.Min(val1_2, val2);
			if ((double)x1 > (double)x2)
				return;
			Pad.Graphics.DrawLine(pen, x1, (float)num2, x2, (float)num2);
			if (!this.yXsAvQ0snw)
				return;
			double num3 = (double)(num1 + 2);
			double num4 = this.k5kAXvwmyK != TriggerType.Above ? (double)(num2 + 2) : (double)(num2 - 2 - (int)Pad.Graphics.MeasureString(str, font).Height);
			Pad.Graphics.DrawString(str, font, Brushes.Black, (float)num3, (float)num4);
		}
Example #13
0
		public virtual void Paint(Pad pad, double XMin, double XMax, double YMin, double YMax)
		{
			Pen Pen = new Pen(this.LineColor);
			Brush brush = this.Dea6GTXBpE != null ? this.Dea6GTXBpE : (Brush)new SolidBrush(this.FillColor);
			for (int Index = 0; Index < this.fNBins; ++Index)
			{
				pad.Graphics.FillRectangle(brush, pad.ClientX(this.GetBinMin(Index)), pad.ClientY(this.fBins[Index]), Math.Abs(pad.ClientX(this.GetBinMax(Index)) - pad.ClientX(this.GetBinMin(Index))), Math.Abs(pad.ClientY(this.fBins[Index]) - pad.ClientY(0.0)));
				pad.DrawLine(Pen, this.GetBinMin(Index), 0.0, this.GetBinMin(Index), this.fBins[Index]);
				pad.DrawLine(Pen, this.GetBinMin(Index), this.fBins[Index], this.GetBinMax(Index), this.fBins[Index]);
				pad.DrawLine(Pen, this.GetBinMax(Index), this.fBins[Index], this.GetBinMax(Index), 0.0);
			}
		}
Example #14
0
		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;
			}
		}
Example #15
0
 public void Paint(Pad Pad, double MinX, double MaxX, double MinY, double MaxY)
 {
   Graphics graphics = Pad.Graphics;
   Pen pen1 = new Pen(Color.Black);
   Pen pen2 = new Pen(Color.Purple, 2f);
   Pen pen3 = new Pen(Color.Blue, 2f);
   Color baseColor1;
   Color baseColor2;
   if (this.RoundTripResultWithoutCost > 0.0)
   {
     baseColor1 = Color.Green;
     baseColor2 = Color.LightGreen;
   }
   else
   {
     baseColor1 = Color.Red;
     baseColor2 = Color.Pink;
   }
   float num1 = (float) Pad.ClientX(MinX);
   float num2 = (float) Pad.ClientX(MaxX);
   float num3 = (float) Pad.ClientY(MinY);
   float num4 = (float) Pad.ClientY(MaxY);
   DateTime dateTime1 = this.EntryDateTime.AddTicks(-(this.ExitDateTime - this.EntryDateTime).Ticks / 4L);
   DateTime dateTime2 = this.ExitDateTime.AddTicks((this.ExitDateTime - this.EntryDateTime).Ticks / 4L);
   float num5 = (float) this.series.GetMax(dateTime1, dateTime2);
   float num6 = (float) this.series.GetMin(dateTime1, dateTime2);
   float width = (float) (((double) num2 - (double) num1) / 3.0);
   float height1 = (float) (((double) num3 - (double) num4) * 2.0 / 3.0 * Math.Abs(this.exitPrice - this.entryPrice) / ((double) num5 - (double) num6));
   float height2 = (float) (((double) num3 - (double) num4) / 10.0);
   float num7 = num1 + (float) (((double) num2 - (double) num1) / 2.0);
   float num8 = this.entryPrice <= this.exitPrice ? (float) ((double) num4 + ((double) num3 - (double) num4) / 6.0 + ((double) num3 - (double) num4) * 2.0 / 3.0 * ((double) num5 - this.entryPrice) / ((double) num5 - (double) num6)) - height1 / 2f : (float) ((double) num4 + ((double) num3 - (double) num4) / 6.0 + ((double) num3 - (double) num4) * 2.0 / 3.0 * ((double) num5 - this.entryPrice) / ((double) num5 - (double) num6)) + height1 / 2f;
   graphics.FillRectangle((Brush) new SolidBrush(Color.FromArgb(170, baseColor2)), num7 - width / 2f, num8 - height1 / 2f, width, height1);
   graphics.FillEllipse((Brush) new SolidBrush(Color.White), num7 - width / 2f, (float) ((double) num8 + (double) height1 / 2.0 - (double) height2 / 2.0), width, height2);
   graphics.FillEllipse((Brush) new SolidBrush(Color.White), num7 - width / 2f, (float) ((double) num8 - (double) height1 / 2.0 - (double) height2 / 2.0), width, height2);
   graphics.FillEllipse((Brush) new SolidBrush(Color.FromArgb(170, baseColor1)), num7 - width / 2f, (float) ((double) num8 + (double) height1 / 2.0 - (double) height2 / 2.0), width, height2);
   graphics.FillEllipse((Brush) new SolidBrush(Color.FromArgb(170, baseColor1)), num7 - width / 2f, (float) ((double) num8 - (double) height1 / 2.0 - (double) height2 / 2.0), width, height2);
   float num9 = 0.0f;
   float num10 = 0.0f;
   for (int index = 0; index < this.series.Count; ++index)
   {
     float num11 = (float) ((double) (this.series.GetDateTime(index) - this.EntryDateTime).Ticks / (double) (this.ExitDateTime - this.EntryDateTime).Ticks * (double) width + (double) num7 - (double) width / 2.0);
     float num12 = (float) (((double) num5 - this.series[index]) / ((double) num5 - (double) num6) * ((double) num3 - (double) num4) * 2.0 / 3.0 + ((double) num3 - (double) num4) / 6.0) + num4;
     if ((double) num9 != 0.0 && (double) num10 != 0.0)
     {
       if (this.series.GetDateTime(index) <= this.EntryDateTime || this.series.GetDateTime(index) > this.ExitDateTime)
       {
         graphics.DrawLine(pen3, num11, num12, num9, num10);
         num9 = num11;
         num10 = num12;
         continue;
       }
       else if ((double) num10 > (double) num8 - (double) height1 / 2.0 && (double) num12 < (double) num8 - (double) height1 / 2.0)
       {
         float num13 = num9 + (float) (((double) num11 - (double) num9) * ((double) num10 - (double) num8 + (double) height1 / 2.0) / ((double) num10 - (double) num12));
         graphics.DrawLine(pen2, num9, num10, num13, num8 - height1 / 2f);
         graphics.DrawLine(pen3, num13, num8 - height1 / 2f, num11, num12);
       }
       else if ((double) num10 < (double) num8 + (double) height1 / 2.0 && (double) num12 > (double) num8 + (double) height1 / 2.0)
       {
         float num13 = num9 + (float) (((double) num11 - (double) num9) * ((double) num8 + (double) height1 / 2.0 - (double) num10) / ((double) num12 - (double) num10));
         graphics.DrawLine(pen2, num9, num10, num13, num8 + height1 / 2f);
         graphics.DrawLine(pen3, num13, num8 + height1 / 2f, num11, num12);
       }
       else if ((double) num10 < (double) num8 - (double) height1 / 2.0 && (double) num12 > (double) num8 - (double) height1 / 2.0)
       {
         float num13 = num9 + (float) (((double) num11 - (double) num9) * ((double) num8 - (double) height1 / 2.0 - (double) num10) / ((double) num12 - (double) num10));
         graphics.DrawLine(pen3, num9, num10, num13, num8 - height1 / 2f);
         graphics.DrawLine(pen2, num13, num8 - height1 / 2f, num11, num12);
       }
       else if ((double) num10 > (double) num8 + (double) height1 / 2.0 && (double) num12 < (double) num8 + (double) height1 / 2.0)
       {
         float num13 = num9 + (float) (((double) num11 - (double) num9) * ((double) num10 - (double) num8 - (double) height1 / 2.0) / ((double) num10 - (double) num12));
         graphics.DrawLine(pen3, num9, num10, num13, num8 + height1 / 2f);
         graphics.DrawLine(pen2, num13, num8 + height1 / 2f, num11, num12);
       }
       else if ((double) num10 < (double) num8 - (double) height1 / 2.0 && (double) num12 < (double) num8 - (double) height1 / 2.0 || (double) num10 > (double) num8 + (double) height1 / 2.0 && (double) num12 > (double) num8 + (double) height1 / 2.0)
         graphics.DrawLine(pen3, num11, num12, num9, num10);
       else if ((double) num10 >= (double) num8 - (double) height1 / 2.0 && (double) num12 >= (double) num8 - (double) height1 / 2.0 && ((double) num10 <= (double) num8 + (double) height1 / 2.0 && (double) num12 <= (double) num8 + (double) height1 / 2.0))
         graphics.DrawLine(pen2, num11, num12, num9, num10);
       else
         graphics.DrawLine(pen3, num11, num12, num9, num10);
     }
     num9 = num11;
     num10 = num12;
   }
   graphics.DrawEllipse(pen1, num7 - width / 2f, (float) ((double) num8 + (double) height1 / 2.0 - (double) height2 / 2.0), width, height2);
   graphics.DrawLine(pen1, num7 - width / 2f, num8 - height1 / 2f, num7 - width / 2f, num8 + height1 / 2f);
   graphics.DrawLine(pen1, num7 + width / 2f, num8 - height1 / 2f, num7 + width / 2f, num8 + height1 / 2f);
   graphics.DrawEllipse(pen1, num7 - width / 2f, (float) ((double) num8 - (double) height1 / 2.0 - (double) height2 / 2.0), width, height2);
 }
Example #16
0
 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;
   }
 }
Example #17
0
File: Pie.cs Project: heber/FreeOQ
		public virtual void Paint(Pad Pad, double XMin, double XMax, double YMin, double YMax)
		{
			double num1 = 0.0;
			for (int index = 0; index < this.pieces.Count; ++index)
				num1 += ((L43w3fFP7y8JGLlRK3)this.pieces[index]).spNC4XmohN();
			int num2 = Pad.ClientX(0.0);
			int num3 = Pad.ClientY(100.0);
			int num4 = Math.Abs(Pad.ClientX(100.0) - Pad.ClientX(0.0));
			int num5 = Math.Abs(Pad.ClientY(100.0) - Pad.ClientY(0.0));
			int num6 = 0;
			int num7 = 0;
			if (num4 > num5)
			{
				num6 = (num4 - num5) / 2;
				num4 = num5;
			}
			else
			{
				num7 = (num5 - num4) / 2;
				num5 = num4;
			}
			int num8 = num5 / 10;
			double num9 = 0.0;
			double num10 = 0.0;
			for (int index = 0; index < this.pieces.Count; ++index)
			{
				double num11 = ((L43w3fFP7y8JGLlRK3)this.pieces[index]).spNC4XmohN() / num1;
				Brush brush = (Brush)new SolidBrush(((L43w3fFP7y8JGLlRK3)this.pieces[index]).EogCymxYKu());
				double num12 = num10 + (double)this.gap;
				num10 += 360.0 * num11;
				double num13 = num10 - num12 + 1.0;
				Pad.Graphics.FillPie(brush, num2 + num6 + num8, num3 + num7 + num8, num4 - 2 * num8, num5 - 2 * num8, (int)num12, (int)num13);
			}
			if (this.enableContour)
			{
				num9 = 0.0;
				double num11 = 0.0;
				for (int index = 0; index < this.pieces.Count; ++index)
				{
					double num12 = ((L43w3fFP7y8JGLlRK3)this.pieces[index]).spNC4XmohN() / num1;
					Pen pen = new Pen(this.contourColor);
					double num13 = num11 + (double)this.gap;
					num11 += 360.0 * num12;
					double num14 = num11 - num13 + 1.0;
					Pad.Graphics.DrawPie(pen, (float)(num2 + num6 + num8), (float)(num3 + num7 + num8), (float)(num4 - 2 * num8), (float)(num5 - 2 * num8), (float)num13, (float)num14);
				}
			}
			num9 = 0.0;
			double num15 = 0.0;
			for (int index = 0; index < this.pieces.Count; ++index)
			{
				double num11 = ((L43w3fFP7y8JGLlRK3)this.pieces[index]).spNC4XmohN() / num1;
				Pen pen = new Pen(this.contourColor);
				double num12 = num15 + (double)this.gap;
				num15 += 360.0 * num11;
				double num13 = num12 + (num15 - num12) / 2.0 + 90.0;
				int num14 = (num4 - 2 * num8) / 4;
				int num16 = (num4 - 2 * num8) / 2;
				Math.Sin(Math.PI / 180.0 * num13);
				int num17 = (num4 - 2 * num8) / 2;
				Math.Cos(Math.PI / 180.0 * num13);
				int num18 = (num4 - 2 * num8) / 2;
				int num19 = (num4 - 2 * num8) / 2 + 10;
				int x1 = (int)((double)(num2 + num6 + num8 + (num4 - 2 * num8) / 2) + (double)num18 * Math.Sin(Math.PI / 180.0 * num13));
				int y1 = (int)((double)(num3 + num7 + num8 + (num4 - 2 * num8) / 2) - (double)num18 * Math.Cos(Math.PI / 180.0 * num13));
				int num20 = (int)((double)(num2 + num6 + num8 + (num4 - 2 * num8) / 2) + (double)num19 * Math.Sin(Math.PI / 180.0 * num13));
				int num21 = (int)((double)(num3 + num7 + num8 + (num4 - 2 * num8) / 2) - (double)num19 * Math.Cos(Math.PI / 180.0 * num13));
				Font font = new Font("Arial", 8);
				Pad.Graphics.DrawLine(new Pen(Color.Gray), x1, y1, num20, num21);
				string str = ((L43w3fFP7y8JGLlRK3)this.pieces[index]).aGNCpFmwcx().Replace(RA7k7APgXK5aSsnmA9.qBCYFXVOKp(828), (num11 * 100.0).ToString(this.format));
				if (num20 > num2 + num6 + num4 / 2)
				{
					Pad.Graphics.DrawLine(new Pen(Color.Gray), num20, num21, num20 + 5, num21);
					SizeF sizeF = Pad.Graphics.MeasureString(str, font);
					Pad.Graphics.DrawString(str, font, (Brush)new SolidBrush(Color.Black), (float)(num20 + 5), (float)num21 - sizeF.Height / 2f);
				}
				else
				{
					Pad.Graphics.DrawLine(new Pen(Color.Gray), num20, num21, num20 - 5, num21);
					SizeF sizeF = Pad.Graphics.MeasureString(str, font);
					Pad.Graphics.DrawString(str, font, (Brush)new SolidBrush(Color.Black), (float)(num20 - 5) - sizeF.Width, (float)num21 - sizeF.Height / 2f);
				}
			}
		}
Example #18
0
		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;
			}
		}
Example #19
0
		public virtual void Paint(Pad pad, double xMin, double xMax, double yMin, double yMax)
		{
			if (this.Style == EGraphStyle.Line && this.LineEnabled)
			{
				Pen pen = new Pen(this.LineColor);
				pen.DashStyle = this.LineDashStyle;
				double X1 = 0.0;
				double Y1 = 0.0;
				bool flag = true;
				foreach (TMarker tmarker in this.points)
				{
					if (!flag)
						pad.DrawLine(pen, X1, Y1, tmarker.X, tmarker.Y);
					else
						flag = false;
					X1 = tmarker.X;
					Y1 = tmarker.Y;
				}
			}
			if ((this.Style == EGraphStyle.Line || this.Style == EGraphStyle.Scatter) && this.MarkerEnabled)
			{
				foreach (TMarker tmarker in this.points)
					tmarker.Paint(pad, xMin, xMax, yMin, yMax);
			}
			if (this.Style != EGraphStyle.Bar)
				return;
			foreach (TMarker tmarker in this.points)
			{
				if (tmarker.Y > 0.0)
					pad.Graphics.FillRectangle(new SolidBrush(Color.Black), pad.ClientX(tmarker.X) - this.BarWidth / 2, pad.ClientY(tmarker.Y), this.BarWidth, pad.ClientY(0.0) - pad.ClientY(tmarker.Y));
				else
					pad.Graphics.FillRectangle(new SolidBrush(Color.Black), pad.ClientX(tmarker.X) - this.BarWidth / 2, pad.ClientY(0.0), this.BarWidth, pad.ClientY(tmarker.Y) - pad.ClientY(0.0));
			}
		}