введите описание изображения здесь Я использую MS Chart для отображения графика свечей. График отображает свечи только зеленого цвета независимо от закрытия свечи. Что я делаю не так в коде ниже
// Set the data
using (StockContext ctx = new StockContext())
{
ohlc = (from stk in ctx.StockOHLCs
where stk.Stock.Symbol == symbol
orderby stk.OHLCDateTime
select stk).ToList();
stockLow = ctx.StockOHLCs.Where(x => x.Stock.Symbol == symbol).Min(x => x.Low);
stockHigh = ctx.StockOHLCs.Where(x => x.Stock.Symbol == symbol).Max(x => x.High);
}
Series oneMinutePrice = new Series("OneMinute");
ChartCandleStick.Series.Add(oneMinutePrice);
ChartCandleStick.Series["OneMinute"].ChartType = SeriesChartType.Candlestick;
ChartCandleStick.Series["OneMinute"]["OpenCloseStyle"] = "Triangle";
ChartCandleStick.Series["OneMinute"]["ShowOpenClose"] = "Both";
ChartCandleStick.Series["OneMinute"]["PointWidth"] = "0.5";
ChartCandleStick.Series["OneMinute"].CustomProperties = "PriceDownColor=Red,PriceUpColor=Green";
ChartCandleStick.Series["OneMinute"].BorderColor = Color.Transparent;
ChartCandleStick.Series["OneMinute"].XValueMember = "OHLCDateTime";
ChartCandleStick.Series["OneMinute"].XValueType = ChartValueType.Time;
ChartCandleStick.Series["OneMinute"].YValueMembers = "Open, High, Low, Close";
ChartCandleStick.Series["OneMinute"].YValueType = ChartValueType.Double;
ch = ChartCandleStick.ChartAreas[0];
ch.AxisX.IntervalType = DateTimeIntervalType.Minutes;
ch.AxisX.Interval = 1;
ch.AxisX.MajorGrid.LineWidth = 0;
ch.AxisY.MajorGrid.LineWidth = 0;
ch.AxisY.Minimum = stockLow;
ch.AxisY.Maximum = stockHigh;
ChartCandleStick.DataManipulator.IsStartFromFirst = true;
ChartCandleStick.DataSource = ohlc;
ChartCandleStick.DataBind();