Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Horizontal line label

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

    Horizontal line label

    Hi,
    I want to add a label to a line that shows what's the last time the price touched the line (see attached example), what is the best to draw this value?

    Thank you.
    Attached Files

    #2
    Hello orenshkol,

    Thanks for your post.

    Can you clarify a bit more?

    Are you wanting to manually add the time price hit the line?

    As an alternative, not quite the same but may be of interest, is the indicator Pricealert indicator (comes with NinjaTrader) that can be added multiple times to a chart and can provide alert(with timestamping) capability. I've created a short video that shows these capabilities. I suspect this may well be an answer for you. http://screencast.com/t/mXoafDVsTLk

    Comment


      #3
      If you look at the attached file you'll see that I want the number of bars since the last time the price touched the line to show up next to the line. Now I know up to write the logic of how to calculate this value, what I'm interested is how do I draw it on the chart next to the line.
      Attached Files

      Comment


        #4
        Hello orenshkol,

        Thanks for your reply.

        You would use the DrawText() method to draw the the text. Here is a link to the helpguide with example: http://ninjatrader.com/support/helpG.../?drawtext.htm

        Comment


          #5
          Yes, but how do I place on the x-coordinate next to the line in the margin and not on the chart itself?

          Comment


            #6
            Hello,

            Thanks for your reply.

            Although not documented, in NT7, you can use a negative bar number, for example:

            Code:
            if (!Historical)
            			{
            				DrawText ("test", "31", -2, Close[0], Color.Red);
            			}
            The example will draw the number 31 2 bars to the right of the current bar, at its close value (when connected to live data). You may need to add to your right side margin to see this.

            Comment


              #7
              Great, thank you.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              83 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              47 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              29 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              32 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              66 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X