SetChartBkGradientFill
- enables background gradient color fill in indicators

Indicators
(AmiBroker 4.90)


SYNTAX SetChartBkGradientFill( topcolor, bottomcolor, titlebkcolor = default, miny= Null, maxy = Null )
RETURNS NOTHING
FUNCTION Enables background gradient color fill in indicators.

Please note that this is independent from chart background color (background color fills entire pane, gradient fill is only for actual chart interior, so axes area is not affected by gradient fill)

  • topcolor - specifies top color of the gradient fill
  • bottomcolor - specifies bottom color of the gradient fill
  • titlebkcolor - (optional) the background color of title text. If not specified then top color is automatically used for title background.
  • miny, maxy - (optional, new in 5.30) - allows gradient area charts in combination with cloud style (see example 2 below)
EXAMPLE

Example 1: basic background gradient

SetChartBkGradientFill( ParamColor("BgTop", colorWhite),ParamColor("BgBottom", colorLightYellow));

Example 2: area gradient chart

function PlotGradientArea( array, caption, ColorTop, ColorBottom )
{
bkclr =
GetChartBkColor();

HH =
HighestVisibleValue( array );
if( NOT IsNull( hh ) ) SetChartBkGradientFill( ColorTop, ColorBottom, bkclr, Null, HH );
Plot( array, Caption, ColorBlend( ColorBottom, colorBlack ) );
PlotOHLC( HH, HH, array, HH, "", bkclr, styleNoLabel | styleNoTitle | styleCloud, Null, Null, 0, -10 );
}

_SECTION_BEGIN("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 ) ) ));
PlotGradientArea(
C, "Close", ParamColor("Top", colorLightOrange), ParamColor("Bottom", colorPaleGreen ) );

_SECTION_END();

SEE ALSO PLOT() function , PLOTFOREIGN() function , PLOTGRID() function , PLOTOHLC() function , PLOTSHAPES() function , PlotText() function , PLOTVAPOVERLAY() function

References:

The SetChartBkGradientFill function is used in the following formulas in AFL on-line library:

More information:

See updated/extended version on-line.