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

Adding a Text Marker to Constant Lines Indicator

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

    Adding a Text Marker to Constant Lines Indicator

    Hi:
    Probably a very simple answer to this one, so apologies for acting dumb.
    I would like to add a text label (e.g. VAH, POC, VAL) to each of the four lines within the Constant Lines indicator - how does one do this with via NinjaScript?
    Would appreciate any pointers.

    many thx
    David

    #2
    You would need to use the DrawText() method.

    RayNinjaTrader Customer Service

    Comment


      #3
      Ray. I don't think that is what I am looking for??? I want something similar that the pivots indicator has, i.e. label associated with horizontal line which can vary from day to day whilst the label remains associated with it. e.g. Daily Pivot point = 13000 & there is a horizontal line at 13000 with a "Daily PP" automatically associated with it. Looking through the script for that particular indicator, it is not easy to ascertain how a label is associated with the value.

      thx !!!
      David

      Comment


        #4
        The label is custom drawn by overriding the indicator's plot method which is outside what we support at this time. There is a reference indicator provided called CustomPlotSample.
        RayNinjaTrader Customer Service

        Comment


          #5
          hmmm
          was expecting this to be simple :-(
          what I am trying to do is the following....................
          I have approx 10 lines which i want to plot on a chart as areas of support or resistance (these will vary on a daily basis) & have labels associated with each line.
          As part of a strategy, I will have a set of entry criteria & also criteria which if violated a trade cannot be entered. One of these will be if price is within 'x' ticks of a specific support or resistance level.
          I was thinking of just simply developing the Constant lines indicator to do this..........it's easy to go from 4 to 10 constant lines in the strategy & associate a variable to them - what i also want to be able to do is add a label to each line.

          any thoughts on how to achieve this?

          thx
          David

          Comment


            #6
            I don't see why you can't use DrawText to add the label onto the line. Have the text be drawn at the latest bar and have it with a y value a little bit above or below the intended line it is to label.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              thx Josh. for the response. I will give it a go.......
              as you are probably aware by now, the big difference between you & I is that you are the expert !! :-)

              thx
              David

              Comment


                #8
                Dgregor5, did you get it?

                I also am interested. I want to add a lable to a constant line. dont want the lable over in price axis but on the chart itself. Can someone post example of how to do this? maybe the constant line indicator already developed but have the draw text code on at least one of the lines, i can go in and do it for the other lines. thanks.

                Comment


                  #9
                  winJR,

                  It is doable via the DrawText() method we mentioned earlier. I am unaware of a sample that shows what you want already, but perhaps the help guide article on DrawText() can provide you with enough guidance in achieving the desired effect.

                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    Also trying to label my lines. Anyone know how I can do this using the DrawText() Method?
                    Attached Files

                    Comment


                      #11
                      Just use the DrawText() method and for your y value, just pass in the line value + a tick? That is likely the closest you can get without it being directly on top.
                      RayNinjaTrader Customer Service

                      Comment


                        #12
                        Still can't get it to work.

                        Originally posted by NinjaTrader_Ray View Post
                        Just use the DrawText() method and for your y value, just pass in the line value + a tick? That is likely the closest you can get without it being directly on top.
                        Attached Files

                        Comment


                          #13
                          AO76,

                          You are drawing 1 bar into the past. When you do this you need to first ensure you have enough bars loaded.

                          Please see this tip: http://www.ninjatrader-support2.com/...ead.php?t=3170
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            Thanks Ray. Got it working.

                            Comment


                              #15
                              Has This Changed at all with NT 7?

                              Has the ability to place labels on a line on a chart been improved/changed with NT7? If not, is DrawText still the only way to do this (or at least the best way)?

                              As a suggestion (assuming this hasn't been addressed already)--it would be great if a label could be added as part of the options on a plot line (with the ability to turn the text on /off and to specify where to show the text (far right, far left, center of chart, etc.)...so it is easy to label a plot on a chart...

                              Just my 2 cents....
                              Jim-Boulder
                              NinjaTrader Ecosystem Vendor - Elephant Tracks

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by pmachiraju, 11-01-2023, 04:46 AM
                              8 responses
                              148 views
                              0 likes
                              Last Post rehmans
                              by rehmans
                               
                              Started by mattbsea, Today, 05:44 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post mattbsea  
                              Started by RideMe, 04-07-2024, 04:54 PM
                              6 responses
                              33 views
                              0 likes
                              Last Post RideMe
                              by RideMe
                               
                              Started by tkaboris, Today, 05:13 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post tkaboris  
                              Started by GussJ, 03-04-2020, 03:11 PM
                              16 responses
                              3,282 views
                              0 likes
                              Last Post Leafcutter  
                              Working...
                              X