Ejemplo n.º 1
0
		public override Distance Distance(int x, double y)
		{
			Distance distance = new Distance();
			Bar bar = this.MainSeries[this.pad.GetDateTime(x)] as Bar;
			distance.DX = 0.0;
			if (bar.Low <= y && y <= bar.High)
			{
				distance.DY = 0.0;
			}
			if (distance.DX == double.MaxValue || distance.DY == double.MaxValue)
				return null;

			StringBuilder sb = new StringBuilder();
			sb.AppendFormat(this.toolTipFormat, new object[]
			{
				this.MainSeries.Name,
				this.MainSeries.Title,
				bar.DateTime.ToString((this.MainSeries as BarSeries).ToolTipDateTimeFormat),
				bar.High,
				bar.Low,
				bar.Open,
				bar.Close,
				bar.Volume
			});			
			distance.ToolTipText = sb.ToString();
			return distance;
		}
Ejemplo n.º 2
0
    private Distance QVTy2A1Hg([In] int obj0, [In] double obj1)
    {
      Distance distance = new Distance();
      DateTime dateTime = this.Pad.GetDateTime(obj0);
      double y = this.mYYSbcj8S.Y;
      distance.X = (double) obj0;
      distance.Y = y;
      int num = this.Pad.ClientX(this.chartFirstDate);
      int x2 = this.Pad.X2;
      distance.DX = num > obj0 || x2 < obj0 ? double.MaxValue : 0.0;
      distance.DY = Math.Abs(obj1 - this.mYYSbcj8S.Y);
      if (distance.DX == double.MaxValue || distance.DY == double.MaxValue)
        return (Distance) null;
      StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendFormat(this.ToolTipFormat, "", this.mYYSbcj8S.Name, dateTime.ToString(), y);
      distance.ToolTipText = stringBuilder.ToString();
      return distance;
    }
Ejemplo n.º 3
0
		public override Distance Distance(int x, double y)
		{
			Distance distance = new Distance();
			DateTime dateTime = this.pad.GetDateTime(x);
			double num = 0.0;
			if (this.option == EIndexOption.Null)
			{
				if (!this.mainSeries.Contains(dateTime))
					return (Distance)null;
				num = this.mainSeries[dateTime];
			}
			if (this.option == EIndexOption.Next)
			{
				if (this.mainSeries.LastDateTime < dateTime.AddTicks(1L))
					return (Distance)null;
				num = this.mainSeries[dateTime.AddTicks(1L), EIndexOption.Next];
			}
			distance.X = x;
			distance.Y = num;
			distance.DX = 0.0;
			distance.DY = Math.Abs(y - num);
			if (distance.DX == double.MaxValue || distance.DY == double.MaxValue)
				return null;
			StringBuilder sb = new StringBuilder();
			sb.AppendFormat(this.ToolTipFormat, this.mainSeries.Name, this.mainSeries.Title, dateTime.ToString(), (object)distance.Y);
			distance.ToolTipText = sb.ToString();
			return distance;
		}
Ejemplo n.º 4
0
    public override Distance Distance(int x, double y)
    {
      Distance distance = new Distance();
      Bar bar = this.kagi[this.pad.GetDateTime(x)];
      distance.DX = 0.0;
      if (y >= bar.Low && y <= bar.High)
        distance.DY = 0.0;
      if (distance.DX == double.MaxValue || distance.DY == double.MaxValue)
        return (Distance) null;
      StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendFormat(this.ToolTipFormat, this.barSeries.Name, this.barSeries.Title, bar.DateTime.ToString(this.barSeries.ToolTipDateTimeFormat), (object) bar.High, (object) bar.Low, (object) bar.Open, (object) bar.Close, (object) bar.Volume);
      distance.ToolTipText = stringBuilder.ToString();
      return distance;
    }
Ejemplo n.º 5
0
    public Distance Distance(int x, double y)
    {
      if (this.signal.DateTime < this.firstDate || this.signal.DateTime > this.lastDate)
        return (Distance) null;
      Distance distance = new Distance();
      int index = this.pad.MainSeries.GetIndex(this.signal.DateTime, EIndexOption.Next);
      distance.X = (double) this.pad.ClientX(this.pad.MainSeries.GetDateTime(index));
      distance.Y = this.signal.Price;
      distance.DX = Math.Abs((double) x - distance.X);
      distance.DY = Math.Abs(y - distance.Y);
      StringBuilder stringBuilder = new StringBuilder();
      if (this.signal.DateTime.Second != 0 || this.signal.DateTime.Minute != 0 || this.signal.DateTime.Hour != 0)
				stringBuilder.AppendFormat(this.ToolTipFormat, "",  this.signal.Side.ToString(), this.signal.Instrument.Symbol, (object) this.signal.Price, (object) this.signal.DateTime, (object) ((object) this.signal.Status).ToString());
      else
				stringBuilder.AppendFormat(this.ToolTipFormat, "", this.signal.Side.ToString(), this.signal.Instrument.Symbol, (object) this.signal.Price, (object) this.signal.DateTime.ToShortDateString(), (object) ((object) this.signal.Status).ToString());
      distance.ToolTipText = ((object) stringBuilder).ToString();
      return distance;
    }
Ejemplo n.º 6
0
		private Distance WWpyQW3r7I([In] int obj0, [In] double obj1)
		{
			Distance distance = new Distance();
			DateTime dateTime = this.pad.GetDateTime(obj0);
			double num;
			if (dateTime == this.chartFirstDate)
				num = this.drawingLine.Y1;
			else if (dateTime == this.chartLastDate)
			{
				num = this.drawingLine.Y2;
			}
			else
			{
				if (dateTime.Ticks > Math.Max(this.drawingLine.X1.Ticks, this.drawingLine.X2.Ticks) || dateTime.Ticks < Math.Min(this.drawingLine.X1.Ticks, this.drawingLine.X2.Ticks))
					return (Distance)null;
				num = this.mXvyM23twN(this.pad.MainSeries.GetIndex(dateTime));
			}
			distance.X = (double)obj0;
			distance.Y = num;
			distance.DX = 0.0;
			distance.DY = Math.Abs(obj1 - num);
			if (distance.DX == double.MaxValue || distance.DY == double.MaxValue)
				return (Distance)null;
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendFormat(this.ToolTipFormat, "", this.drawingLine.Name, (object)dateTime.ToString(), (object)num);
			distance.ToolTipText = stringBuilder.ToString();
			return distance;
		}
Ejemplo n.º 7
0
        public virtual void MouseMove(MouseEventArgs Event)
        {
            if (this.chart.MainSeries == null || this.chart.MainSeries.Count == 0 || (Event.X <= this.x1 || Event.X >= this.x2))
            {
                return;
            }
            double num1    = 10.0;
            double num2    = (this.maxValue - this.minValue) / 20.0;
            int    x       = Event.X;
            double y       = this.WorldY(Event.Y);
            bool   flag    = false;
            string caption = "";

            this.rGBJ83tF8c = false;
            foreach (IChartDrawable chartDrawable in this.notDatePrimitives)
            {
                if (this.drawItems || chartDrawable is SeriesView)
                {
                    Distance distance = chartDrawable.Distance(x, y);
                    if (distance != null && distance.DX < num1 && distance.DY < num2)
                    {
                        if (chartDrawable.ToolTipEnabled)
                        {
                            if (caption != "")
                            {
                                caption = caption + ";";
                            }
                            caption = caption + distance.ToolTipText;
                            flag    = true;
                        }
                        this.rGBJ83tF8c = true;
                        if (Cursor.Current != Cursors.Hand)
                        {
                            Cursor.Current = Cursors.Hand;
                        }
                    }
                }
            }
            if (this.drawItems)
            {
                int      num3      = 0;
                int      index1    = this.chart.MainSeries.GetIndex(this.GetDateTime(Event.X));
                DateTime dateTime1 = this.chart.MainSeries.GetDateTime(index1);
                if (index1 != 0)
                {
                    DateTime dateTime2 = this.chart.MainSeries.GetDateTime(index1 - 1);
                    num3 = this.datePrimitives.GetNextIndex(dateTime2);
                    if (this.datePrimitives.Contains(dateTime2))
                    {
                        ++num3;
                    }
                }
                int prevIndex = this.datePrimitives.GetPrevIndex(dateTime1);
                if (num3 != -1 && prevIndex != -1)
                {
                    for (int index2 = num3; index2 <= prevIndex; ++index2)
                    {
                        foreach (IChartDrawable chartDrawable in this.datePrimitives[index2])
                        {
                            Distance distance = chartDrawable.Distance(x, y);
                            if (distance != null && distance.DX < num1 && distance.DY < num2)
                            {
                                if (chartDrawable.ToolTipEnabled)
                                {
                                    if (caption != "")
                                    {
                                        caption = caption + "";
                                    }
                                    caption = caption + distance.ToolTipText;
                                    flag    = true;
                                }
                                this.rGBJ83tF8c = true;
                                if (Cursor.Current != Cursors.Hand)
                                {
                                    Cursor.Current = Cursors.Hand;
                                }
                            }
                        }
                    }
                }
            }
            if (flag)
            {
                this.chart.toolTip.SetToolTip((Control)this.chart, caption);
                this.chart.toolTip.Active = true;
            }
            else
            {
                this.chart.toolTip.Active = false;
            }
        }
Ejemplo n.º 8
0
		public override Distance Distance(int x, double y)
		{
			Distance distance = new Distance();
			DateTime dt = this.pad.GetDateTime(x);
			int index = this.series.GetIndex(dt);
			distance.DX = 0.0;
			if (y <= this.series[index, BarData.Volume])
			{
				distance.DY = 0.0;
			}
			if (distance.DX == double.MaxValue || distance.DY == double.MaxValue) return null;
			StringBuilder sb = new StringBuilder();
			sb.AppendFormat(this.ToolTipFormat, new object[]
			{
				this.series.Name,
				this.series.Title,
				dt.ToString(this.series.ToolTipDateTimeFormat),
				this.series[index, BarData.Volume]
			});
			distance.ToolTipText = sb.ToString();
			return distance;
		}
Ejemplo n.º 9
0
    private Distance iZicacow9y([In] int obj0, [In] double obj1)
    {
      Distance distance = new Distance();
      distance.X = (double) obj0;
      distance.Y = obj1;
      int num1 = this.pad.ClientX(this.chartFirstDate);
      int num2 = this.pad.X2;
      if (this.nkbcpi5r41.Status != StopStatus.Active)
      {
        if (this.chartLastDate == DateTime.MaxValue)
          this.chartLastDate = this.pad.Series.GetDateTime(this.pad.Series.GetIndex(this.nkbcpi5r41.CompletionTime, EIndexOption.Prev));
        num2 = this.pad.ClientX(this.chartLastDate);
      }
      distance.DX = num1 > obj0 || num2 < obj0 ? double.MaxValue : 0.0;
      double num3 = this.nkbcpi5r41.Status != StopStatus.Executed ? Math.Abs(this.nkbcpi5r41.StopPrice) : Math.Abs(this.nkbcpi5r41.FillPrice);
      if (this.nkbcpi5r41.Type == StopType.Time)
        num3 = this.nkbcpi5r41.StopPrice;
      distance.DY = Math.Abs(obj1 - num3);
      if (distance.DX == double.MaxValue || distance.DY == double.MaxValue)
        return distance;
      StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendFormat(this.ToolTipFormat, this.nkbcpi5r41.Status.ToString(), (object) num3);
      distance.ToolTipText = ((object) stringBuilder).ToString();
      return distance;
    }
Ejemplo n.º 10
0
    private Distance wCEcoUk0GZ([In] int obj0, [In] double obj1)
    {
      Distance distance = new Distance();
      DateTime dateTime = this.pad.GetDateTime(obj0);
      double num;
      if (dateTime == this.chartFirstDate)
        num = this.nkbcpi5r41.Series[0];
      else if (dateTime == this.chartLastDate)
      {
        num = this.nkbcpi5r41.Series.Last;
      }
      else
      {
        if (!this.nkbcpi5r41.Series.Contains(dateTime))
          return (Distance) null;
        num = this.nkbcpi5r41.Series[dateTime];
      }
      distance.X = (double) obj0;
      distance.Y = num;
      distance.DX = 0.0;
      distance.DY = Math.Abs(obj1 - num);
      if (distance.DX == double.MaxValue || distance.DY == double.MaxValue)
        return (Distance) null;
      StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendFormat(this.ToolTipFormat, this.nkbcpi5r41.Status.ToString(), dateTime.ToString(), num);
      distance.ToolTipText = ((object) stringBuilder).ToString();
      return distance;
    }
Ejemplo n.º 11
0
 public Distance Distance(int x, double y)
 {
   Distance distance = new Distance();
   int index = this.pad.Series.GetIndex(this.AMKwObevl9.DateTime, EIndexOption.Prev);
   distance.X = (double) this.pad.ClientX(this.pad.Series.GetDateTime(index));
   distance.Y = this.AMKwObevl9.Price;
   distance.DX = Math.Abs((double) x - distance.X);
   distance.DY = Math.Abs(y - distance.Y);
   StringBuilder stringBuilder = new StringBuilder();
   if (this.AMKwObevl9.DateTime.Second != 0 || this.AMKwObevl9.DateTime.Minute != 0 || this.AMKwObevl9.DateTime.Hour != 0)
     stringBuilder.AppendFormat(this.toolTipFormat, (object) ((object) this.AMKwObevl9.Side).ToString(), (object) this.AMKwObevl9.Instrument.Symbol, (object) this.AMKwObevl9.Qty, (object) this.AMKwObevl9.Price.ToString(this.AMKwObevl9.Instrument.PriceDisplay), (object) this.AMKwObevl9.DateTime, (object) this.AMKwObevl9.Text);
   else
     stringBuilder.AppendFormat(this.toolTipFormat, (object) ((object) this.AMKwObevl9.Side).ToString(), (object) this.AMKwObevl9.Instrument.Symbol, (object) this.AMKwObevl9.Qty, (object) this.AMKwObevl9.Price.ToString(this.AMKwObevl9.Instrument.PriceDisplay), (object) this.AMKwObevl9.DateTime.ToShortDateString(), (object) this.AMKwObevl9.Text);
   distance.ToolTipText = ((object) stringBuilder).ToString();
   return distance;
 }