IsNinjaScriptDrawn

View as Markdown

Definition

Indicates if the chart anchor was drawn by a NinjaScript object (such as an indicator or strategy).

Property Value

A bool value which returns true if the object was drawn by another NinjaScript object; otherwise false. This property is read-only.

Syntax

\<chartanchor\>.IsNinjaScriptDrawn

Examples

1//unlocks the NinjaScript drawn object and allows the user to modify the anchor, while the NinjaScript object still 'owns' the object
2protected override void OnBarUpdate()
3{
4 foreach(IDrawingTool dt in DrawObjects)
5 {
6 DrawingTools.Line sampleLine = dt as DrawingTools.Line;
7
8 if (sampleLine != null && sampleLine.StartAnchor.IsNinjaScriptDrawn)
9 {
10 sampleLine.IsLocked = false;
11 Print(sampleLine.StartAnchor.ToString());
12 }
13 }
14}