NinjaScript > Language Reference > Drawing >

BarColor

Print this Topic Previous pageReturn to chapter overviewNext page

Definition

Sets the color of a price bar.

 

Property Value

A color structure that represents the color of this price bar.

 

Syntax

BarColor

 

 

Examples

// Sets the bar color to yellow
BarColor = Color.Yellow;

 

// Sets the bar color to its default color as defined in the chart properties dialog
BarColor = Color.Empty;

 

// Sets the bar color to yellow if the 20 SMA is above the 50 SMA and the closing
// price is above the 20 SMA (see image below)
if (SMA(20)[0] > SMA(50)[0] && Close[0] > SMA(20)[0])
    BarColor = Color.Yellow;