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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        637 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        366 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        571 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X