×

Sign up and get MultiCharts free

Use its powerful simulation mode with data included out of the box. Just fill out the form and start honing your trading skills with a few clicks.

Changes - MultiCharts
Open main menu

Changes

GradientColor

1,534 bytes added, 14:27, 17 January 2012
Created page with "Returns an RGB color number, representing a shade of color from within a defined color range. The gradient shade of color is determined by the value of the specified numerical..."
Returns an RGB color number, representing a shade of color from within a defined color range. The gradient shade of color is determined by the value of the specified numerical expression in relation to the defined value range.
For example, if the color range is defined as White to Black, and the value range is defined from 0 to 2, GradientColor will return an RGB color number representing White for the value of 0, Gray for the value of 1, and Black for the value of 2. White will be returned for all values < 0, and Black for all values > 2.

==== Usage ====
<syntaxhighlight>GradientColor(Value,Min,Max,StartColor,EndColor)</syntaxhighlight>

Where: <syntaxhighlight>Value</syntaxhighlight> – the specified numerical expression
<syntaxhighlight>Min</syntaxhighlight> – the minimum value of the value range; if Value=Min, StartColor is returned
<syntaxhighlight>Max</syntaxhighlight> – the maximum value of the value range; if Value=Max, EndColor is returned
<syntaxhighlight>StartColor</syntaxhighlight> – the starting color of the color range
<syntaxhighlight>EndColor</syntaxhighlight> – the ending color of the color range

==== Example ====
Plot an ADX indicator in Gradient Color, where Magenta gradually changes into White for the indicator values from 5 to 50:


<syntaxhighlight>Variable:ADXValue(0);
ADXValue=ADX(14);
Plot1(ADXValue,"ADXValue");
SetPlotColor (1,GradientColor (ADXValue,5,50, Magenta,White));</syntaxhighlight>




[[Category:Colors]]
Anonymous user