AssignValueColor ( CustomColor color);

Default values:


Paints intervals of a plot with desired colors depending on a condition. The specified colors override the default color set for the plot. Note that when used in script for a custom quote, this function sets the color of the quote value.

Input parameters

Parameter Default value Description
color - Defines color to be applied to the plot.


plot Diff = close - close[1];
Diff.AssignValueColor(if Diff >= 0 then Color.UPTICK else Color.DOWNTICK);

In this example, if the difference between the current closing value and the closing value for the previous bar is positive, the Diff plot is painted green, otherwise it is painted red.

Colors can be specified in the following ways:

Note that you can change colors of a plot in the Edit Studies dialog only if you use the Color function to define these colors. In the rest of cases you can change the colors only by editing the source code of a study.