How to fix the code so that there are no brakes?
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
for (int chartBarIndex = ChartBars.FromIndex; chartBarIndex <= ChartBars.ToIndex; chartBarIndex++)
{
// current bar prices
double barClosePrice = ChartBars.Bars.GetClose(chartBarIndex);
double barOpenPrice = ChartBars.Bars.GetOpen(chartBarIndex);
double barHighPrice = ChartBars.Bars.GetHigh(chartBarIndex);
double barLowPrice = ChartBars.Bars.GetLow(chartBarIndex);
// current bar X and Y points
int x = chartControl.GetXByBarIndex(ChartBars, chartBarIndex) - (int)chartControl.BarWidth;
float barX = chartControl.GetXByBarIndex(ChartBars, chartBarIndex);
float barOpenY = chartScale.GetYByValue(barOpenPrice);
float barCloseY = chartScale.GetYByValue(barClosePrice);
float barHighY = chartScale.GetYByValue(barHighPrice);
float barLowY = chartScale.GetYByValue(barLowPrice);
SharpDX.Direct2D1.Brush footPrintBarBrushDX = Brushes.White.ToDxBrush(RenderTarget);
RenderTarget.FillRectangle(new RectangleF(barX, barOpenY, 2, barCloseY - barOpenY), footPrintBarBrushDX);
footPrintBarBrushDX.Dispose();
}
}

Comment