Need Help: Bar Chart Color

#11
Hi

Is this what you ask for? Here you can change the colours of upbars and downbars.

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", H, L, C, SelectedValue( ROC( C, 1 ) ) ));
upColor = ParamColor("Up Color", colorDarkGreen );
downColor = ParamColor("Down Color", colorRed );
Plot( C, "Close", IIf( C>Ref(C,-1), upcolor, downColor), styleNoTitle | ParamStyle("Style") | GetPriceStyle() | styleThick);
_SECTION_END();
 
Last edited:
#12
Thank you donjoe for your efforts but I dont need this one. It is showing open price also. I dont want to see open prices in my chart. I want just high low and close prices with change in color as per yesterdays close.

Hope I am able to explain you my requirement properly.
 
#13
Hello again,

Here I think we have the correct chart, but you have to play around a bit to get the layout you want.

_SECTION_BEGIN("HLC chart no open");


// Get Previous Day's close, Low and High
Prev_Close = TimeFrameGetPrice( "C", inDaily, -1, expandFirst);

Color = IIf(Prev_Close < C, colorDarkGreen, colorRed);

PlotOHLC(Null,H, L, C, "O == C Chart", Color, 128 | styleThick);
_SECTION_END();
 
Last edited:
#14
Thank you donjoe !!

This is the exact AFL I was looking for.

One more request, if possible kindly give me afl for volume also with change in colors as per yesterdays close.

Thanks once again
 
Last edited:
#15
Hello

I think this AFL could work, try it.

_SECTION_BEGIN("Volume");

Plot(Volume,_DEFAULT_NAME(), IIf(C <= Ref(C,-1), colorRed, colorDarkGreen), styleHistogram | styleThick, maskHistogram);

_SECTION_END();

Regards
 

Similar threads