UpBrushDX

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Chart Style >

UpBrushDX

Previous page Return to chapter overview Next page

Definition

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

 

Property  Value

A SharpDX Brush object used to paint the up bars

 

Syntax

UpBrushDX

 

Examples

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