i added the necessary property for "dojiSize" - the size below which the body will outline the candle body color
i used what i thought was the body outline code and placed a copy of it in each conditional routine beneath the Rectangle drawing conditions and above the body color brush disposal
the code will compile but when i open the indicator dialogue to add it to the chart the program essentially locks up working on something as evidenced by the CPU usage in task manager - but won't finish and just keeps chunking some kinds of data
I must have coded some kind of sticky loop but i'm not skilled enough to be able to understand and find the problems
it may be that i'm not using DX brushes properly by putting another conditional draw before the up or down brush is disposed
or something like returning out of the secondary condition nest
if some help could be offered it would really be appreciated /thx
here's my hack job:
SharpDX.Direct2D1.Brush shadowColordx = shadowColor.ToDxBrush(RenderTarget); // prepare for the color to use
var xy2 = new Vector2(x, y2);
var xy3 = new Vector2(x, y3);
RenderTarget.DrawLine(xy2, xy3, shadowColordx, shadowWidth);
if (y4 == y1)
RenderTarget.DrawLine( new Vector2( x - barPaintWidth / 2, y1), new Vector2( x + barPaintWidth / 2, y1), shadowColordx, shadowWidth);
else
{
if (y4 > y1)
{
SharpDX.Direct2D1.Brush barColorDowndx = barColorDown.ToDxBrush(RenderTarget); // prepare for the color to use /// Original Line 0
RenderTarget.FillRectangle( new RectangleF(x - barPaintWidth / 2, y1, barPaintWidth, y4 - y1), barColorDowndx); /// Original Line 1
if ( (y4-y1) < ( DojiSize * TickSize) ) /// ADDED TO OUTLINE SPINNING TOPS BAR WITH BAR COLOR FOR VISIBILITY
{
RenderTarget.DrawRectangle( new RectangleF( x - barPaintWidth / 2 + (float)shadowWidth / 2,
Math.Min(y4, y1), barPaintWidth - (float)shadowWidth, Math.Abs(y4 - y1)), barColorDowndx, shadowWidth); /// ADDED FROM BELOW
}
barColorDowndx.Dispose(); /// Original Line 2
}
else
{
SharpDX.Direct2D1.Brush barColorUpdx = barColorUp.ToDxBrush(RenderTarget); // prepare for the color to use /// Original Line 0
RenderTarget.FillRectangle( new RectangleF(x - barPaintWidth / 2, y4, barPaintWidth, y1 - y4),barColorUpdx); /// Original Line 1
if ( (y1-y4) < ( DojiSize * TickSize ) ) /// ADDED TO OUTLINE SPINNING TOPS BAR WITH BAR COLOR FOR VISIBILITY
{
RenderTarget.DrawRectangle( new RectangleF( x - barPaintWidth / 2 + (float)shadowWidth / 2,
Math.Min(y4, y1), barPaintWidth - (float)shadowWidth, Math.Abs(y4 - y1)), barColorUpdx, shadowWidth); /// ADDED FROM BELOW
}
barColorUpdx.Dispose(); /// Original Line 2
}
//// RenderTarget.DrawRectangle( new RectangleF( x - barPaintWidth / 2 + (float)shadowWidth / 2,
//// Math.Min(y4, y1), barPaintWidth - (float)shadowWidth, Math.Abs(y4 - y1)), shadowColordx, shadowWidth);
}
shadowColordx.Dispose();

Comment