Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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

        Click image for larger version

Name:	Drawing Objects UPLOAD.jpg
Views:	212
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:	193
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.
                  JesseNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Salahinho99, 05-05-2024, 04:13 AM
                  4 responses
                  47 views
                  0 likes
                  Last Post Salahinho99  
                  Started by goodknight777, Today, 08:43 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post goodknight777  
                  Started by damethetrader, Today, 08:31 AM
                  1 response
                  4 views
                  0 likes
                  Last Post NinjaTrader_Clayton  
                  Started by ttrader23, Yesterday, 09:04 AM
                  6 responses
                  29 views
                  0 likes
                  Last Post ttrader23  
                  Started by reynoldsn, Today, 07:23 AM
                  3 responses
                  7 views
                  1 like
                  Last Post NinjaTrader_Gaby  
                  Working...
                  X