DrawRegressionChannel()
Previous Topic  Next Topic 

Definition
Draws a regression channel.

Syntax
DrawRegressionChannel(string tag, int startBarsAgo, int endBarsAgo, Color color)
DrawRegressionChannel(string tag, bool autoScale, int startBarsAgo, int endBarsAgo, Color upperColor, DashStyle upperDashStyle, int upperWidth, Color middleColor, DashStyle middleDashStyle, int middleWidth, Color lowerColor, DashStyle lowerDashStyle, int lowerWidth)

Method Of

Custom Indicator, Custom Strategy


Parameters

tag

A user defined unique id used to reference the draw object. For example, if you pass in a value of "myTag", each time this tag is used, the same draw object is modified. If unique tags are used each time, a new draw object will be created each time.

autoScale

Determines if the draw object will be included in the y-axis scale. Default value is true.

startBarsAgo

The starting bar (x axis co-ordinate) where the regression channel will start

endBarsAgo

The end bar (x axis co-ordinate) used as the 2nd anchor point of the regression channel

color

The draw object color (reference)

upperDashStyle,
middleDashStyle,

lowerDashStyle

DashStyle.Dash
DashStyle.DashDot
DashStyle.DashDotDot
DashStyle.Dot
DashStyle.Solid
(reference)

upperColor,

middleColor,

lowerColor

The line colors (reference)

upperWidth,

middleWidth,

lowerWidth

The line width


Examples

// Draws a green regression channel starting 10 bars back
DrawRegressionChannel("myTag" + CurrentBar, 10, 0, Color.Green);