> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# BackBrush

## Definition

Sets the brush used for painting the chart panel's background color for the current bar.

This property will only set the back color for the panel the indicator is running. To set background color for all panels, please see the [BackBrushAll](/developer/desktop-sdk/references/common/drawing/backbrushall) property.

## Property Value

A [Brush](http://msdn.microsoft.com/en-us/library/system.windows.media.brush\(v=vs.110\).aspx) object that represents the color of the current chart bar.

## Syntax

`BackBrush`

You may have up to 65,535 unique `BackBrush` instances, therefore, using [static predefined brushes](/developer/desktop-sdk/guides/educational-resources/working-with-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

```csharp
protected override void OnBarUpdate()
{
     // Sets the chart panel back color to pale green
     BackBrush = Brushes.PaleGreen;

     // Sets the back color to to null which will use the default color set in the chart properties dialog window
     BackBrush = null;

     // Sets the back color to maroon when the closing price is less than the 20 period SMA // and to lime green when above (see image below)
     BackBrush = SMA(20)[0] >= Close[0] ? Brushes.Maroon : Brushes.LimeGreen;
}
```

![MAPriceBars](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/ninjatrader-public.docs.buildwithfern.com/0163e920f5011924fed1ff15c1f52f2b2d1347eff238d172ac4bf437b75c3e7f/docs/assets/developer/desktop-sdk/references/backbrush-mapricebars.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260729%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260729T062145Z&X-Amz-Expires=604800&X-Amz-Signature=903bd45b9ec56d3e1f3413962797d3f4078c7c12afdf42ef4a144a15a2dd841d&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)