> 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.

# UpBrushDX

## Definition

A SharpDX [Brush](/developer/desktop-sdk/references/sharpdx/sharpdx-direct2d1/sharpdx-direct2d1-brush) object used to paint the up bars for the ChartStyle.

## Property  Value

A [SharpDX](/developer/desktop-sdk/references/sharpdx/sharpdx-direct2d1) Brush object used to paint the up bars

## Syntax

`UpBrushDX`

## Examples

```csharp
protected override void OnRender(ChartControl chartControl, ChartScale chartScale, ChartBars chartBars)  
{  
  for (int idx = chartBars.FromIndex; idx <= chartBars.ToIndex; idx++)  
      {  
          double     closeValue             = bars.GetClose(idx);  
          double     openValue               = bars.GetOpen(idx);  
   
          // Set the brush of the current candle to UpBrushDX or DownBrushDX, depending on the  
          // bar direction  
          Brush brush = closeValue >= openValue ? UpBrushDX : DownBrushDX;  
      }  
}
```