Draw.Ruler()

View as Markdown

Definition

Draws a ruler.

Method Return Value

A Ruler object that represents the draw object.

Syntax

Draw.Ruler(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, int textBarsAgo, double textY)

Draw.Ruler(NinjaScriptBase owner, string tag, bool isAutoScale, DateTime startTime, double startY, DateTime endTime, double endY, DateTime textTime, double textY)

Draw.Ruler(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, int textBarsAgo, double textY, bool isGlobal, string templateName)

Draw.Ruler(NinjaScriptBase owner, string tag, bool isAutoScale, DateTime startTime, double startY, DateTime endTime, double endY, DateTime textTime, double textY, bool isGlobal, string templateName)`

Parameters

ParameterDescription
ownerThe hosting NinjaScript object which is calling the draw method. Typically will be the object which is calling the draw method (e.g., “this”).
tagA 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.
isAutoScaleDetermines if the draw object will be included in the y-axis scale.
startBarsAgoThe number of bars ago (x value) of the 1st anchor point.
startTimeThe time of the 1st anchor point.
startYThe y value of the 1st anchor point.
endBarsAgoThe number of bars ago (x value) of the 2nd anchor point.
endTimeThe time of the 2nd anchor point.
endYThe y value of the 2nd anchor point.
textBarsAgoThe number of bars ago (x value) of the 3rd anchor point.
textTimeThe time of the 3rd anchor point.
textYThe y value of the 3rd anchor point.
isGlobalDetermines if the draw object will be global across all charts which match the instrument.
templateNameThe name of the drawing tool template the object will use to determine various visual properties (empty string could be used to just use the UI default visuals instead).

Examples

1// Draws a ruler measuring the primary bar series
2Draw.Ruler(this, "tag1", true, 4, Low[4], 3, High[3], 1, Low[1]);