Color

Color ( String name);

Default values:

Description

Gets a plot color using the title of the color. Note that the color should be defined using the DefineColor function.

Input parameters

Parameter Default value Description
name - Defines the name of the color.

Example

declare lower;
plot Price = close;
Price.DefineColor("Up", Color.UPTICK);
Price.DefineColor("Down", Color.DOWNTICK);
Price.AssignValueColor(if Price >= Price[1] then Price.Color("Up") else Price.Color("Down"));

The code paints the closing plot with "Up" and "Down" colors depending on the price change as compared to the previous bar.