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

        Click image for larger version

Name:	Drawing Objects UPLOAD.jpg
Views:	207
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:	188
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 fx.practic, 10-15-2013, 12:53 AM
                  5 responses
                  5,404 views
                  0 likes
                  Last Post Bidder
                  by Bidder
                   
                  Started by Shai Samuel, 07-02-2022, 02:46 PM
                  4 responses
                  95 views
                  0 likes
                  Last Post Bidder
                  by Bidder
                   
                  Started by DJ888, Yesterday, 10:57 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by MacDad, 02-25-2024, 11:48 PM
                  7 responses
                  159 views
                  0 likes
                  Last Post loganjarosz123  
                  Started by Belfortbucks, Yesterday, 09:29 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post Belfortbucks  
                  Working...
                  X