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
    Paul H.NinjaTrader Customer Service

    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
        Paul H.NinjaTrader Customer Service

        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.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Great, thank you.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by ageeholdings, Today, 07:43 AM
              0 responses
              7 views
              0 likes
              Last Post ageeholdings  
              Started by pibrew, Today, 06:37 AM
              0 responses
              4 views
              0 likes
              Last Post pibrew
              by pibrew
               
              Started by rbeckmann05, Yesterday, 06:48 PM
              1 response
              14 views
              0 likes
              Last Post bltdavid  
              Started by llanqui, Today, 03:53 AM
              0 responses
              6 views
              0 likes
              Last Post llanqui
              by llanqui
               
              Started by burtoninlondon, Today, 12:38 AM
              0 responses
              12 views
              0 likes
              Last Post burtoninlondon  
              Working...
              X