Example #1
0
        public void ShowCandleSeries(pres.TimeFrame timeFrame, IEnumerable <StockIntervalData> candelSeries)
        {
            CandleSeries.Items.Clear();
            IEnumerable <OxyPlot.Series.HighLowItem> hl = candelSeries.Select(
                x => new OxyPlot.Series.HighLowItem(OxyPlot.Axes.DateTimeAxis.ToDouble(x.date),
                                                    (double)x.high, (double)x.low, (double)x.open, (double)x.close)
                );

            CandleSeries.Items.AddRange(hl);
            if (timeFrame == TimeFrame.Month)
            {
                DateAxis.IntervalType      = OxyPlot.Axes.DateTimeIntervalType.Months;
                DateAxis.MinorIntervalType = OxyPlot.Axes.DateTimeIntervalType.Months;
            }
            else if (timeFrame == TimeFrame.Week)
            {
                DateAxis.IntervalType      = OxyPlot.Axes.DateTimeIntervalType.Weeks;
                DateAxis.MinorIntervalType = OxyPlot.Axes.DateTimeIntervalType.Weeks;
            }
            else if (timeFrame == TimeFrame.Day)
            {
                DateAxis.IntervalType      = OxyPlot.Axes.DateTimeIntervalType.Days;
                DateAxis.MinorIntervalType = OxyPlot.Axes.DateTimeIntervalType.Days;
            }
        }
Example #2
0
 public void ShowMovingAverage(pres.TimeFrame timeFrame, IList <StockIntervalData> candelSeries)
 {
     Average.Points.Clear();
     foreach (Worker.Average c in worker.movingAverage(candelSeries, 50))
     {
         DataPoint p = new DataPoint(OxyPlot.Axes.DateTimeAxis.ToDouble(c.date), (double)c.valueAverage);
         Average.Points.Add(p);
     }
 }