DownBrushDX

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Chart Style >

DownBrushDX

Previous page Return to chapter overview Next page

Definition

A SharpDX Brush object used to paint the down bars for the ChartStyle.

 

Property  Value

A SharpDX Brush object used to paint the down bars

 

Syntax

DownBrushDX

 

Example

ns

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;
      }
}