NinjaScript > Language Reference > Drawing >

DrawRegressionChannel()

Print this Topic Previous pageReturn to chapter overviewNext page

Definition
Draws a regression channel.

 

Method Return Value

An IRegressionChannel object that represents the draw object.

 

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)

DrawRegressionChannel(string tag, bool autoScale, DateTime startTime, DateTime endTime, Color upperColor, DashStyle upperDashStyle, int upperWidth, Color middleColor, DashStyle middleDashStyle, int middleWidth, Color lowerColor, DashStyle lowerDashStyle, int lowerWidth)
 

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

startBarsAgo

The starting bar (x axis co-ordinate) where the draw object will be drawn. For example, a value of 10 would paint the draw object 10 bars back.

startTime

The starting time where the draw object will be drawn.

endBarsAgo

The end bar (x axis co-ordinate) where the draw object will terminate

endTime

The end time where the draw object will terminate

color

The draw object color (reference)

upperDashStyle,
middleDashStyle,
lowerDashStyle

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

 

Note: Fancier DashStyles like DashDotDot will require more resources than simple DashStyles like Solid.

upperColor,
middleColor,
lowerColor

The line colors (reference)

upperWidth,
middleWidth,

lowerWidth

The line width

 

 

Examples

// Draws a regression channel from the low 10 bars back to the high of 5 bars back
DrawRegressionChannel("tag1", 10, 0, Color.Blue);