Draw.PathTool()

View as Markdown

Definition

Draws a path which can have a user defined set of anchors.

Method Return Value

A PathTool object that represents the draw object.

Syntax

Draw.PathTool(NinjaScriptBase owner, string tag, bool isAutoScale, List\<chartanchor\> chartAnchors, bool isGlobal, string templateName)

Draw.PathTool(NinjaScriptBase owner, string tag, bool isAutoScale, List\<chartanchor\> chartAnchors, Brush brush, DashStyleHelper dashStyle)

Draw.PathTool(NinjaScriptBase owner, string tag, bool isAutoScale, int anchor1BarsAgo, double anchor1Y, int anchor2BarsAgo, double anchor2Y, int anchor3BarsAgo, double anchor3Y)

Draw.PathTool(NinjaScriptBase owner, string tag, bool isAutoScale, DateTime Anchor1Time, double anchor1Y, DateTime Anchor2Time, double anchor2Y, DateTime Anchor3Time, double anchor3Y)

Draw.PathTool(NinjaScriptBase owner, string tag, bool isAutoScale, int anchor1BarsAgo, double anchor1Y, int anchor2BarsAgo, double anchor2Y, int anchor3BarsAgo, double anchor3Y, int anchor4BarsAgo, double anchor4Y)

Draw.PathTool(NinjaScriptBase owner, string tag, bool isAutoScale, DateTime Anchor1Time, double anchor1Y, DateTime Anchor2Time, double anchor2Y, DateTime Anchor3Time, double anchor3Y, DateTime Anchor4Time, double anchor4Y)

Draw.PathTool(NinjaScriptBase owner, string tag, bool isAutoScale, int anchor1BarsAgo, double anchor1Y, int anchor2BarsAgo, double anchor2Y, int anchor3BarsAgo, double anchor3Y, int anchor4BarsAgo, double anchor4Y, int anchor5BarsAgo, double anchor5Y)

Draw.PathTool(NinjaScriptBase owner, string tag, bool isAutoScale, DateTime Anchor1Time, double anchor1Y, DateTime Anchor2Time, double anchor2Y, DateTime Anchor3Time, double anchor3Y, DateTime Anchor4Time, double anchor4Y, DateTime Anchor5Time, double anchor5Y)

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. Default value is false.
chartAnchorsA list of the chart anchors.
anchor1BarsAgoThe bar the first anchor of the object will be drawn at. A value of 10 would be 10 bars ago.
anchor2BarsAgoThe bar the second anchor of the object will be drawn at. A value of 10 would be 10 bars ago.
anchor3BarsAgoThe bar the third anchor of the object will be drawn at. A value of 10 would be 10 bars ago.
anchor4BarsAgoThe bar the forth anchor of the object will be drawn at. A value of 10 would be 10 bars ago.
anchor5BarsAgoThe bar the fifth anchor of the object will be drawn at. A value of 10 would be 10 bars ago.
anchor1YThe first anchor y value.
anchor2YThe second anchor y value.
anchor3YThe third anchor y value.
anchor4YThe forth anchor y value.
anchor5YThe fifth anchor y value.
Anchor1TimeThe time the first anchor of the object will be drawn at.
Anchor2TimeThe time the second anchor of the object will be drawn at.
Anchor3TimeThe time the third anchor of the object will be drawn at.
Anchor4TimeThe time the forth anchor of the object will be drawn at.
Anchor5TimeThe time the fifth anchor of the object will be drawn at.
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 PathTool object based on bars ago and y anchors
2Draw.PathTool(this, "tag1", false, 20, 194, 10, 184, 13, 176, 25, 182);
3
4// Draws a PathTool object based on a list of anchors with specified times
5List<chartanchor> anchors = new List<chartanchor>();
6anchors.Add(new ChartAnchor(new DateTime(2018, 5, 25), 194, ChartControl));
7anchors.Add(new ChartAnchor(new DateTime(2018, 6, 12), 184, ChartControl));
8anchors.Add(new ChartAnchor(new DateTime(2018, 6, 7), 176, ChartControl));
9anchors.Add(new ChartAnchor(new DateTime(2018, 5, 21), 182, ChartControl));
10Draw.PathTool(this, "tag1", false, anchors, Brushes.CornflowerBlue, DashStyleHelper.Solid, Brushes.CornflowerBlue, 40);