StyleGradient plot style

Currently the StyleGradient fades from light to dark from top to bottom. Is it possible to invert the fading, i.e. go from light at the bottom to dark at the top? This would help to invert the buy and sell coloring scheme. Thanks.

@spoostrader1 have you tried using SetGradientFill ? I am not an expert in Ami's charting capabilities but is seems capable of meeting almost anyone's preference.

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

which allows you to choose the top and bottom colors. So for example dark at top changing as you go lower.

image

1 Like

Thanks. That will do it!

hello @spoostrader1

The answer of @portfoliobuilder was fine and correct.

Here is one more example and maybe is more easy to understand it by using ParamColor()

/// @link https://www.amibroker.com/guide/afl/setgradientfill.html

topclr = ParamColor("Top color", colorLightOrange); 
BotClr = ParamColor("Bottom color", colorPaleGreen );
SetGradientFill( topclr, BotClr );
// Plot Close Price with styleGradient
Plot( C, "Close", ColorBlend( BotClr, colorBlack ), styleGradient | styleLine, Null, Null, 0, -1 );

.
.
the reason that i reply on this post, is not just to give you one more example code. But I really do not understand what you mean below. Can you please explain

2 Likes

Typically the gradient starts off with light color at the top and goes to dark color at the bottom. If you are buying when prices are down then the gradient doesn't overwrite the price bars. Now if you are selling when the prices are high the light color gradient is at the top and covering up the prices. So for sell I had rather have dark color at the top and light color at the bottom.

1 Like