AddChartRegion()

Description

AddChartRegion() fills a specific area on a chart.

Usage

AddChartRegion(string name, int barsBackStart, int barsBackEnd, IDataSeries series, double y, Color outlineColor, Color areaColor, int areaOpacity)
AddChartRegion(string name, int barsBackStart, int barsBackEnd, IDataSeries series1, IDataSeries series2, Color outlineColor, Color areaColor, int areaOpacity)
AddChartRegion(string name, DateTime startTime, DateTime endTime, IDataSeries series, double y, Color outlineColor, Color areaColor, int areaOpacity)
AddChartRegion(string name, DateTime startTime, DateTime endTime, IDataSeries series1, IDataSeries series2, Color outlineColor, Color areaColor, int areaOpacity)

Return Value

A drawing object of the type IRegion (interface)

Parameter

name

A clearly identifiable name for the drawing object

barsBackStart

Sets the preceding bar at which the drawing should begin (0 = current bar)

startTime

Start time for the drawing

barsBackEnd

Sets the preceding bar at which the drawing should end (0 = current bar)

endTime

The end time for the drawing

series1, series2

Every data series, for example, an indicator, close, high, low, and so on. The respective value of the data series for the current bar is used as a y-value.

y

Any double value

outlineColor

Color for the border

areaColor

Fill color for the area

areaOpacity

Transparency of the fill color. Value between 0 and 255 (0 = completely transparent, 255 = completely opaque)

Example

// Fills the area between the upper and lower Bollinger Bands
AddChartRegion("MyRegion-" + ProcessingBarIndex, ProcessingBarIndex, 0, Bollinger(2, 14).Upper, Bollinger(2, 14).Lower, Color.Empty, Color.Lime, 100);

Last updated