private void DrawPolyLineInternal(StrategyPolyLine polyLine) { IList <float> line = polyLine.Prices; Color color = polyLine.Color; PriceRectangle priceRect = mapping.PriceRect; int start = priceRect.StartIndex; int end = priceRect.EndIndex + 1; PriceShape_PolyLine polyline = new PriceShape_PolyLine(); for (int index = start; index <= end; index++) { if (index >= line.Count) { return; } if (index < 0) { continue; } float price = line[index]; if (price == float.MinValue) { continue; } PriceShape_Point point = new PriceShape_Point(index, price); polyline.AddPoint(point); } polyline.Color = color; DrawShape(polyline); }
public void DrawPolyLine(PricePolyLine polyLine) { PriceRectangle priceRect = mapping.PriceRect; int start = priceRect.StartIndex; int end = priceRect.EndIndex; for (int i = 0; i < polyLine.Points.Count; i++) { PricePoint point = polyLine.Points[i]; } }
public override bool Equals(object obj) { if (!(obj is PriceRectangle)) { return(false); } PriceRectangle rect = (PriceRectangle)obj; return(this.priceLeft == rect.priceLeft && this.priceRight == rect.priceRight && this.priceTop == rect.priceTop && this.priceBottom == rect.priceBottom); }
private void DrawShape(IPriceShape shape) { if (shape is StrategyShape) { this.DrawShape2((StrategyShape)shape); } else { PriceRectangle priceRect = mapping.PriceRect; int start = priceRect.StartIndex; int end = priceRect.EndIndex; if (shape.GetShapeType() == PriceShapeType.Point) { PriceShape_Point point = (PriceShape_Point)shape; if (point.X < start || point.X > end) { return; } } this.drawer.DrawPriceShape(shape); } }
private void DrawPointsInternal(StrategyPoints points) { PriceRectangle priceRect = mapping.PriceRect; int start = priceRect.StartIndex; int end = priceRect.EndIndex; IList <float> prices = points.Points; for (int i = start; i <= end; i++) { if (i >= prices.Count) { return; } if (prices[i] == float.MinValue) { continue; } PriceShape_Point point = new PriceShape_Point(i, prices[i]); point.Width = points.Width; point.Color = points.Color; DrawShape(point); } }
public void Paint(PriceRectangle priceRectangle) { }