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

        Click image for larger version

Name:	Drawing Objects UPLOAD.jpg
Views:	492
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:	468
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 cmoran13, 04-16-2026, 01:02 PM
                  0 responses
                  51 views
                  0 likes
                  Last Post cmoran13  
                  Started by PaulMohn, 04-10-2026, 11:11 AM
                  0 responses
                  31 views
                  0 likes
                  Last Post PaulMohn  
                  Started by CarlTrading, 03-31-2026, 09:41 PM
                  1 response
                  165 views
                  1 like
                  Last Post NinjaTrader_ChelseaB  
                  Started by CarlTrading, 04-01-2026, 02:41 AM
                  0 responses
                  100 views
                  1 like
                  Last Post CarlTrading  
                  Started by CaptainJack, 03-31-2026, 11:44 PM
                  0 responses
                  160 views
                  2 likes
                  Last Post CaptainJack  
                  Working...
                  X