public static void GetRangeY(StickItem curve, int fromId, int toId, ref ValueRange yRange) { for (int idx = fromId; idx <= toId; idx++) { PointPair item = (PointPair)curve.Points[idx]; if (item.Y < yRange.Min) yRange.Min = item.Y; if (item.Y > yRange.Max) yRange.Max = item.Y; } }
public static void GetRangeY(CurveItem curve,int fromId, int toId,ref ValueRange range) { if (curve.GetType() == typeof(JapaneseCandleStickItem)) { GetRangeY((curve as JapaneseCandleStickItem), fromId, toId, ref range); return; } if (curve.GetType() == typeof(LineItem)) { GetRangeY((curve as LineItem), fromId, toId, ref range); return; } if (curve.GetType() == typeof(BarItem)) { GetRangeY((curve as BarItem), fromId, toId, ref range); return; } if (curve.GetType() == typeof(StickItem)) { GetRangeY((curve as StickItem), fromId, toId, ref range); return; } }
public static void GetRangeY(JapaneseCandleStickItem curve, int fromId, int toId, ref ValueRange yRange) { for (int idx = fromId; idx <= toId; idx++) { StockPt item = (StockPt)curve.Points[idx]; if (item.Low < yRange.Min) yRange.Min = item.Low; if (item.High > yRange.Max) yRange.Max = item.High; } }
public static void GetRangeY(StickItem curve, int fromId, int toId, ref ValueRange yRange) { fromId = Math.Max(fromId, 0); toId = Math.Min(toId, curve.Points.Count - 1); for (int idx = fromId; idx <= toId; idx++) { if (idx < 0 || idx >= curve.Points.Count) continue; PointPair item = (PointPair)curve.Points[idx]; if (item.Y < yRange.Min) yRange.Min = item.Y; if (item.Y > yRange.Max) yRange.Max = item.Y; } }