Change Color on Backtest Portfolio Equity Report Chart

I am looking to change colors on the Backtest Portfolio Equity report, and am failing. Basically just looking for a white background instead of black. Here is the standard code for the report:

Title = "Portfolio Equity = " + C;

SetGradientFill( colorLightOrange, colorPaleGreen  );
Plot( C, "Portfolio Equity", ColorBlend( colorPaleGreen, colorBlack ), styleGradient | styleLine, Null, Null, 0, -1 );

//SetChartOptions(3, chartShowDates );

And here is my latest failed attempt at changing the colors:

Title = "Portfolio Equity = " + C;
GfxSetBkMode( 1 );
GfxSetBkColor( ColorWhite );
GfxSetTextColor( colorDarkGrey );
SetGradientFill( colorLightOrange, colorPaleGreen  );
Plot( C, "Portfolio Equity", ColorBlend( colorPaleGreen, colorBlack ), styleGradient | styleLine, Null, Null, 0, -1 );

//SetChartOptions(3, chartShowDates );

I was hoping the GfxSetBkColor and GfxSetTextColor lines would change the background and the text color on the new chart. But it basically looks the same. Anyone do this successfully? Thanks!

1 Like

Use SetChartBkColor()

https://www.amibroker.com/guide/afl/setchartbkcolor.html

1 Like

Try this one

Title = "Portfolio Equity = " + C;

SetChartBkColor(colorwhite); // color of outer border
SetChartBkGradientFill(colorlightorange,colorPaleGreen,colorBlack); // color of inner panel
Plot( C, "Portfolio Equity", ColorBlend( colorPaleGreen, colorBlack ), styleGradient | styleLine, Null, Null, 0, -1 );

//SetChartOptions(3, chartShowDates );
2 Likes

Thanks guys!

SetChartBkColor and SetChartBkGradientFill along with adjusting the colors in the "Plot" statement allow me to change it nicely. Only thing I cannot seem to change is the text on the X and Y axis. Would like to make it black or red or something other than white so that I can use SetChartBkColor with colorWhite. See image below for numbers I am struggling to change the color of:

image

Thanks!

1 Like

@QEdges,

Axes font color can be changed only from Tools - Preferences - Colors - Axes (text).
There is not an AFL option for that one (yes, you may use Gfx but I meant there isn't simple option).

3 Likes