Bar Style Candlesticks

#1
Hi,


is it possible to code in afl bar style candlesticks? Wht i mean is when current candle close is less than previous candle thn it will be a down candlesticks and color red. when current candle close is high thn previous candle it will be up candle with color green.

below is my attemp to it but the problem is the outline/border color of candle is same as body color instead of black (which default use to have). Can it be done kindly help if yes?

any other improvement in the code plz suggest.


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 ) ) ));
Plot( Close, "Price", IIf( Close > Ref(Close,-1), colorDarkTeal,IIf(Close < Ref(Close,-1), colorRed,colorBlack )), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

regds,
 
#3
Hi,


is it possible to code in afl bar style candlesticks? Wht i mean is when current candle close is less than previous candle thn it will be a down candlesticks and color red. when current candle close is high thn previous candle it will be up candle with color green.

below is my attemp to it but the problem is the outline/border color of candle is same as body color instead of black (which default use to have). Can it be done kindly help if yes?

any other improvement in the code plz suggest.


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 ) ) ));
Plot( Close, "Price", IIf( Close > Ref(Close,-1), colorDarkTeal,IIf(Close < Ref(Close,-1), colorRed,colorBlack )), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

regds,

Code:
_SECTION_BEGIN("Price Chart");
bgTop = ParamColor("BgTop",    colorBlack);
bgBot = ParamColor("BgBottom", colorBlack);
SetChartBkGradientFill( bgTop ,bgBot, colorLightGrey);

pStyle = ParamList("Price Style", "Candle|Solid Candle|Bar|Line|Heikin-Ashi",2);
cBull = ParamColor("Price Bull", colorLime);
CBear = ParamColor("Price Bear", colorRed);
cLine = ParamColor("Price Line", colorWhite);


SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}}- {{INTERVAL}} {{DATE}} O= %g, H= %g, L= %g, C= %g (%.1f%%) V= " +WriteVal( V, 1.0 ) +"\n{{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));

ThisStyle = styleCandle;
ThisTitle = "";

_O=O; _C=C; _H=H; _L=L;

ThisColor = IIf( _C>_O, cBull, IIf(_C<_O, CBear, CLine));


switch (pStyle )
{

  case "Solid Candle":   
        SetBarFillColor( ThisColor ); 
        break;


  case "Bar": 
       ThisStyle = styleBar;
       break;

  case "Line": 
      ThisStyle = styleLine;
      ThisColor = cLine;
       break;


  case "Heikin-Ashi": 
       _C = (O+H+L+C)/4; 
		  _O = AMA( Ref( _C, -1 ), 0.5 ); 
       _H = Max( H, Max( _C, _O ) ); 
       _L = Min( L, Min( _C, _O ) ); 

       ThisColor = IIf(_C >= _O,CBull, CBear);
       SetBarFillColor( ThisColor );
 
       ThisColor = IIf(_C >= _O,cLine, cLine);
		  ThisTitle = "Heikin-Ashi";
       break;

  default:   
        SetBarFillColor( ThisColor ); 
        ThisColor = cLine;

       break;

}

   PlotOHLC( _O, _H, _L, _C, ThisTitle, ThisColor, ThisStyle); 
   GraphXSpace = 8;

_SECTION_END();
 

Similar threads