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:	585
Size:	68.3 KB
ID:	1266213

        Click image for larger version

Name:	Drawing Objects UPLOAD.jpg
Views:	499
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:	478
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 Hwop38, 05-04-2026, 07:02 PM
                  0 responses
                  160 views
                  0 likes
                  Last Post Hwop38
                  by Hwop38
                   
                  Started by CaptainJack, 04-24-2026, 11:07 PM
                  0 responses
                  307 views
                  0 likes
                  Last Post CaptainJack  
                  Started by Mindset, 04-21-2026, 06:46 AM
                  0 responses
                  244 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by M4ndoo, 04-20-2026, 05:21 PM
                  0 responses
                  348 views
                  0 likes
                  Last Post M4ndoo
                  by M4ndoo
                   
                  Started by M4ndoo, 04-19-2026, 05:54 PM
                  0 responses
                  178 views
                  0 likes
                  Last Post M4ndoo
                  by M4ndoo
                   
                  Working...
                  X