Following is the sample code we used for OHLC with RemoveGaps:
Code: Select all
DataTable CashVolume;
CashVolume = Graph.GetCashVolume() //DB Proc to Get OHLC Data
DateTime date;
double open = 0, close = 0, high = 0, low = 0, vol = 0;
Candle newSeries = new Candle();
newSeries.VertAxis = VerticalAxis.Right;
newSeries.UpCloseColor = Theme.TeeChartSeriesUpColor;
newSeries.DownCloseColor = Theme.TeeChartSeriesDownColor;
newSeries.TreatNulls = TreatNullsStyle.Skip;
newSeries.Marks.Style = MarksStyles.Value;
newSeries.Marks.MultiLine = true;
this.tChart1.Series.Add(newSeries);
for (int i = 0; i < CashVolume.Rows.Count; i++)
{
date = (DateTime)CashVolume.Rows[i][(int)Graph.CashVolumeCol.TimeStamp];
open = (double)(CashVolume.Rows[i][(int)Graph.CashVolumeCol.OpenPrice]);
close = (double)(CashVolume.Rows[i][(int)Graph.CashVolumeCol.ClosePrice]);
high = (double)(CashVolume.Rows[i][(int)Graph.CashVolumeCol.HighPrice]);
low = (double)(CashVolume.Rows[i][(int)Graph.CashVolumeCol.LowPrice]);
newSeries.Add(date, open, high, low, close);
}
newSeries.RemoveGaps = true;
Code: Select all
DataTable CashVolume;
CashVolume = Graph.GetCashVolume() //DB Proc to Get OHLC Data
DateTime date;
double open = 0, close = 0, high = 0, low = 0, vol = 0;
Bar newBarSeries = new Bar();
newBarSeries.VertAxis = VerticalAxis.Right;
this.tChart1.Series.Add(newBarSeries);
for (int i = 0; i < CashVolume.Rows.Count; i++)
{
date = (DateTime)CashVolume.Rows[i][(int)Graph.CashVolumeCol.TimeStamp];
vol = (int)(CashVolume.Rows[i][(int)Graph.CashVolumeCol.Volume]);
newBarSeries.Add(date, vol);
}