Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Label Horizontal Line with Text

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

    #31
    Originally posted by iwanko View Post
    Good morning, I arrived at this discussion when looking for a label on the horizontal lines.
    I accessed the link
    https://ninjatraderecosystem.com/use...-drawing-tool/

    posted earlier right here and downloaded the updated plug-in. I installed it as requested on his own download page, but he even adds the horizontal line and the label appears, but if I double-click the line to edit it by pressing OK he gives the following error in popup:



    This error only occurs entering the line properties without even making any edits to its properties.
    My NT8 version 8.0.22.2 64-bit - portuguese Brazil version

    Sorry my bad English!!

    Thiago Iwanko



    UPDATE:
    I already solved the problem, it was necessary to delete the old graphics with my studies and create new graphics, there it worked perfectly.
    iwanko,

    Please, could you give more details on how you solved the problem. I'm having the same issue ... what do you mean by 'old graphics" and "new graphics".

    Omololu

    Comment


      #32
      I'm really interested in a developing a global horizontal line drawing tool that supports both custom labels and automatically append price. The Labeled Lines Drawing Tool that NinjaTrader_Jim developed pretty much is that, but I see the append price feature was removed for global draw objects because it would cause those lines to be removed when adding a new chart template. I'm curious to know what the root cause of that issue is? I'm assuming it deleted the GlobalDrawingObject xml template for some reason? Was any thought put into providing a solution for that issue vs. simply not allowing it? Thanks.

      Comment


        #33
        Hello martyn73,

        Rounding price to TickSize specifically does not work with Global Drawing Objects and this tool.

        I use GetAttachedToChartBars to get the Instrument that the object is drawn on to be able to round the price to the right tick size, but this is not compatible with Global Drawing objects.

        If you wanted to get rid of the rounding to TickSize behavior, you could remove where masterInst is used and then be able to remove GetAttachedToCharBars.

        This should then work for Global Drawing object purposes.

        GetAttachedToCharBars - https://ninjatrader.com/support/help...ochartbars.htm

        I can't make any promises since this was a pet project I worked on my free time, but I may make those modifications some time in the future to only reference Instrument/GetAttachedToChartBars when rounding is needed.
        Last edited by NinjaTrader_Jim; 04-04-2022, 07:58 AM.
        JimNinjaTrader Customer Service

        Comment


          #34
          Great, thanks for the feedback Jim.

          Comment


            #35
            Just a follow up. Not sure how clean of a solution this is but I got it to work by getting the tick size of the instrument in OnRender for global drawing objects.

            ChartBars cb = chartScale.GetFirstChartBars();

            if (cb != null)
            tickSize = cb.Bars.Instrument.MasterInstrument.TickSize;

            I then did my own rounding calculation instead of using RoundToTickSize().





            Comment


              #36
              Hi
              I have downloaded the code but it is not labelling my lines - everything is checked. Code runs on pricechange. Any thoughts?

              Comment


                #37
                Hello Mindset,

                The LabeledLines drawing tool adds additional drawing tools which add the label, it does not add labels to existing lines.

                If you want to use LabeledLines in NinjaScript, you will need to call the appropriate Draw method.

                I.E.

                If you type:

                DrawLL.

                after you press the '.' key, you can use Intelliprompt to see the available methods.

                Using Intelliprompt - https://ninjatrader.com/support/help...elliprompt.htm

                JimNinjaTrader Customer Service

                Comment


                  #38
                  Thanks Jim - I read your code and found the correct syntax. One thought - would it be possible to add an override so that you could add your own text rather than just price. ( or even as additional text eg "My stop line")
                  I tried but couldn't do it.

                  Comment


                    #39
                    Try this in an Indicator:
                    Code:
                    public override string FormatPriceMarker(double price)
                    {
                        return "MyText " + Instrument.MasterInstrument.FormatPrice(price);
                    }
                    Can't say for DrawingTools though.

                    Thanks.
                    Last edited by jeronymite; 05-27-2022, 01:47 AM.
                    Multi-Dimensional Managed Trading
                    jeronymite
                    NinjaTrader Ecosystem Vendor - Mizpah Software

                    Comment


                      #40
                      Thank you for posting the link to labeled lines. I have added it to my platform, but I'm wondering if there are any examples of how to implement this feature, specifically how to draw a horizontal line at a specific price point with an accompanying label. Thanks in advance.

                      Comment


                        #41
                        DrawLL.LabeledHorizontalLine(this,"LXLine",price,B rushes.Fuchsia,true);
                        Also works as a global line using NinjaTraders labeled lines Drawing Tool

                        you can name it as well eg myline = DrawLL.......
                        you can sort the text you want in the properties and then just save as a default

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by burtoninlondon, Today, 12:38 AM
                        0 responses
                        5 views
                        0 likes
                        Last Post burtoninlondon  
                        Started by AaronKoRn, Yesterday, 09:49 PM
                        0 responses
                        12 views
                        0 likes
                        Last Post AaronKoRn  
                        Started by carnitron, Yesterday, 08:42 PM
                        0 responses
                        11 views
                        0 likes
                        Last Post carnitron  
                        Started by strategist007, Yesterday, 07:51 PM
                        0 responses
                        13 views
                        0 likes
                        Last Post strategist007  
                        Started by StockTrader88, 03-06-2021, 08:58 AM
                        44 responses
                        3,982 views
                        3 likes
                        Last Post jhudas88  
                        Working...
                        X