BackBrushAll

View as Markdown

Definition

A collection of prior back brushes used for the background colors for all chart panels.

Property Value

A Brush object that represents the color of the current chart bar.

To reset the Chart background color to the default background color property, set the BackBrushAll to null for that bar.

Syntax

BackBrushAll

You may have up to 65,535 unique BackBrushAll instances, therefore, using static predefined brushes should be favored. Alternatively, in order to use fewer brushes, please try to cache your custom brushes until a new brush would actually need to be created.

Examples

1protected override void OnBarUpdate()
2{
3 // Sets the back color to pale green
4 BackBrushAll = Brushes.PaleGreen;
5
6 // Sets the back color to null to use the default color set in the chart properties dialog window
7 BackBrushAll = null;
8
9 // Sets the back color to pink when the closing price is less than the 20 period SMA
10 // and to lime green when above (see image below)
11 BackBrushAll = SMA(20)[0] >= Close[0] ? Brushes.Pink : Brushes.PaleGreen;
12}

MAPriceBars2