...............
else
{
if (tuple.Second == null ||
tuple.Second.XValue != chartTime)
{
var point = new DataPoint
(chartTime, new[]
{
(double)candle.LowPrice,
(double)candle.HighPrice,
(double)candle.OpenPrice,
(double)candle.ClosePrice,
(double)candle.TotalVolume // Добавьте, пожалуйста, объем!
})
{
BorderColor = WinColor.DarkSlateGray,
ToolTip = "{0}{6}O = {1}{6}H = {2}{6}L = {3}{6}C = {4}{6}V = {5}"
.Put
(candle.OpenTime, candle.OpenPrice, candle.HighPrice, candle.LowPrice, candle.ClosePrice, candle.TotalVolume, Environment.NewLine), Color = chartCandles.ColorPriceUp.ToWin(),
BackSecondaryColor = chartCandles.ColorPriceDown.ToWin(),
};
tuple.First.Points.Add(point);
tuple.Second = point;
}
......................
var tradesElem = elem as ChartTradeElement;
if (tradesElem != null)
{
var trade = (MyTrade)pair.Value;
var tuple = _tradeSeries[tradesElem];
if (trade == null)
{
tuple.Item1.Points.Add(new DataPoint
{
XValue = chartTime,
YValues = new double[1],
IsEmpty = true,
});
tuple.Item2.Points.Add(new DataPoint
{
XValue = chartTime,
YValues = new double[1],
IsEmpty = true,
});
}
else
{
var point = new DataPoint
{
XValue = chartTime,
YValues = new[] { (double) Math.Round(trade.Trade.Price, 3) }, // Округление до трех знаков после запятой!
ToolTip = trade.ToString(),
};
.......................
else
{
var point = new DataPoint
{
XValue = chartTime,
YValues = new[] { (double)Math.Round(order.Price, 3) }, // Округление до трех знаков после запятой!
ToolTip = order.ToString(),
};
var main = order.Direction == OrderDirections.Buy ? tuple.Item1 : tuple.Item2;
var oppos = order.Direction == OrderDirections.Buy ? tuple.Item2 : tuple.Item1;
main.Points.Add(point);
oppos.Points.Add(new DataPoint
{
XValue = chartTime,
YValues = new double[1],
IsEmpty = true,
});
UpdateMinMax(order.Price);
}
........................