Continuation Candle Color - Border is missing

Seeing a strange issue. Please go through the following code.

_SECTION_BEGIN("Continuation_Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));

CandleType = ParamList("CandleType","Normal|CC", 0);
if (StrMatch(CandleType, "Normal"))
{
	//Taken from Basic chart - Price
	Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
}
else 
{
	//color array is based on the previous value of C
	color = IIf(C>=Ref(C,-1), colorBrightGreen,colorRed);
	
	Plot(C, "Close", color, styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
}
_SECTION_END();

Not able to understand why the body outline is getting affected when I choose CC (continuation candle) as I am expecting body color is only getting applied by the color array.

Where am I going wrong? Sincerely appreciate your help.

Thanks
Tarak

Here is the image of showing the difference.
Left is from the Basic Price chart. Right is from the option "CC" As you can note the body outline is missing.

image

You are using Plot() in the general sense. It does not know that you are plotting candles unless you specifically tell it.

There is a styleCandle = 64 - candlestick chart that you should be using.
https://www.amibroker.com/guide/afl/plot.html

Also, the styleCandle is properly set with SetBarFillColor( colorarray )
https://www.amibroker.com/guide/afl/setbarfillcolor.html

1 Like

Thank you @nsm51

The code should be

_SECTION_BEGIN("Continuation_Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));

CandleType = ParamList("CandleType","Normal|CC", 0);
if (StrMatch(CandleType, "Normal"))
{
	//Taken from Basic chart - Price
	Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
}
else 
{
	//color array is based on the previous value of C
	SetBarFillColor(IIf(C>=Ref(C,-1), colorBrightGreen,colorRed));
	Plot(C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
}
_SECTION_END();