Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using "Labeled Lines Drawing Tool" by NinjaTraderJimm in ninjascript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Using "Labeled Lines Drawing Tool" by NinjaTraderJimm in ninjascript

    Hi i found this post https://forum.ninjatrader.com/forum/...bel-lines-rays, and this answer

    "I have a DrawingTool that expands the built in Lines DrawingTool to add a label. If you want to use them with NinjaScript, you can use DrawLL.LabeledRay() in place of Draw.Ray()"

    There is some sample about use DrawLL​?

    If i need use labeled vertical line the code, maybe i need use something like this? DrawLL.VerticalLabeledLine(this, "tag1", 0, Brushes.Black);

    How can i call DrawLL, i have this error:

    Click image for larger version  Name:	image.png Views:	0 Size:	2.2 KB ID:	1266100​​​

    #2
    Hello mjairg,

    Are you certain you have imported the drawing tool script and you are able to draw this on a chart?

    Attached is a test script that calls DrawLL.LabeledVerticalLine().
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks a lot, is working now, i change the LabeledLines.cs for your file, now i can continue my script, again thanks a lot

      Comment


        #4
        I understand that I can use one of the following methods to draw a vertical labeled line


        DrawLL.VerticalLine(NinjaScriptBase owner, string tag, DateTime time, Brush brush)
        DrawLL.VerticalLine(NinjaScriptBase owner, string tag, DateTime time, Brush brush, DashStyleHelper dashStyle, int width, bool drawOnPricePanel)
        DrawLL.VerticalLine(NinjaScriptBase owner, string tag, int barsAgo, Brush brush)
        DrawLL.VerticalLine(NinjaScriptBase owner, string tag, int barsAgo, Brush brush, DashStyleHelper dashStyle, int width, bool drawOnPricePanel)
        DrawLL.VerticalLine(NinjaScriptBase owner, string tag, int barsAgo, bool isGlobal, string templateName)
        DrawLL.VerticalLine(NinjaScriptBase owner, string tag, DateTime time, bool isGlobal, string templateName)

        in the properties window we can see its parameters and values, my question is how can i write the text value (marked in red) using one of the methods​


        Click image for larger version

Name:	Sin-título-1.png
Views:	564
Size:	68.3 KB
ID:	1266213

        Click image for larger version

Name:	Drawing Objects UPLOAD.jpg
Views:	481
Size:	150.1 KB
ID:	1266214


        Comment


          #5

          Hello, for now I have managed to export the data that interests me from the labeled vertical line to a .csv file, the date loads fine, I still can't find a way to load the text attached to the line file, any recommendations?​

          Comment


            #6
            Hello mjairg,

            Code:
            LabeledVerticalLine myVLine = DrawLL.LabeledVerticalLine(this, "labelVLine" + CurrentBar, 0, Brushes.Red);
            myVLine.DisplayText = "SAMPLE TEXT";
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Is working, thanks a lot Chelsea.

              Comment


                #8
                Is there a way to modify the tool, so once a line is drawn i can make it global. with horizontal lines i am getting this when i make it global after drawing it. I get this when i try and apply a labeled object to all charts manually.Click image for larger version

Name:	image.png
Views:	455
Size:	6.6 KB
ID:	1267244

                Comment


                  #9
                  Hello JPMARTINUS,

                  You would need to use the overload that has IsGlobal:

                  Code:
                  var myLine = DrawLL.LabeledHorizontalLine(this, "myLine" , Close[0], true, null);
                  myLine.AppendPriceTime = false;
                  Keep in mind this script was not made to support AppendPriceTime, to support that option you would have to edit the drawing tool and add logic to support that​
                  Last edited by NinjaTrader_Jesse; 09-04-2023, 08:07 AM.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  571 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  331 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  101 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  549 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  550 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X