Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add text or label to indicator line

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

    Add text or label to indicator line

    I am trying to create a label for each of a few indicator lines on a chart. I am testing with a simple "Running high" which plots the high for the last x number of bars. How would I add a text label to that line on the right side of the chart?
    I have looked at Draw.Text, but I get errors. Where should it go? Is there an example somewhere I could use to base it on?
    Thanks,
    Mel

    #2
    Hello ClimberMel,

    Thanks for your note.

    I understand that you are getting an error when using the Draw.Text() method. What exactly does the error report?

    The Draw.Text() help guide page could be used to see the syntax used for this method as well as sample code. See the help guide page below.

    Draw.Text(): https://ninjatrader.com/support/help.../draw_text.htm

    Also, I attached a simple example script to this reply demonstrating calling the Draw.Text() method in a NinjaScript to draw text on a chart which you may find helpful.

    Let us know if we may assist further.
    Attached Files
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Thanks, I'll check out the example. If I still don't get it to work, I'll grab the exact error and reply. It was to do with it didn't work in this context... so I gathered I didn't have the line in the right section. I really need to learn ninjascript better, but in the past I have always been able to find something vaguely similar and just modify it with my code... so all the sections were already laid out.
      Thanks, I'll let you know what happens.

      Comment


        #4
        Thanks! That example was exactly what I needed. I had to put the Draw.Text in the onBarUpdate with the indicator. It compiled fine. Then I just had to set the y parameter to the indicator value so that it plots on the indicator line!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        57 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        78 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        39 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        101 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        61 views
        0 likes
        Last Post PaulMohn  
        Working...
        X