Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Text Box / Header

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

    Text Box / Header

    I would like a strategy to create a large text box, or header on the top margin that displays text based on certain conditions met.

    How would I go about coding this.
    Attached Files

    #2
    Hello Kubera2024,

    Thank you for your note.

    You could use the following method, DrawTextFixed, passing TextPosition.TopLeft in for the syntax for TextPosition.



    I was able to find a indicator sample on the forum which displays text in the upper left of the chart you could reference as a sample,


    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      What would the code look like to display only when the current state of conditions are true. I'm getting even past historical states displayed.

      Comment


        #4
        Hello Kubera2024,

        I have attached a screen shot of what the text drawn will look like.

        So I can best answer your question could you please rephrase what you are asking? Or what your issue is?

        I look forward to your reply.
        Attached Files
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          That’s what mine looks like but it overwrites in the same field previous signals.

          Comment


            #6
            I made a set of conditions, if all are true it writes on the screen. But the conditions toggle between false and true so it writes both onto the same part of the screen. I would like it to write only the most recent signal.

            Comment


              #7
              Hello Kubera2024,

              I would suggest passing the DrawTextFixed method a string value of nothing when the condition is not true.

              For example,

              Code:
              if(true)
              DrawTextFixed("tag1", "Blah Blah", TextPosition.TopLeft);
              
              else
              
              DrawTextFixed("tag1", "", TextPosition.TopLeft);
              You’ll notice we are passing a string value of “” to the DrawTextFixed method, so while it’s still being called, the text its drawing is “”.

              Please let us know if you need further assistance.
              Alan P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              630 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              364 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              105 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              566 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              568 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X