Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Text at top left of chart in strategy

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

    Text at top left of chart in strategy

    I need to draw some text at the top left of my chart. How do I do that in a C# strategy in NT8? Do you have some sample code that does this?

    #2
    Hello westofpluto,

    You could use Draw.TextFixed for this:

    https://ninjatrader.com/support/help...tsub=textfixed

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Ok thanks. Suppose I want to update that text at the close of each bar. Is there a way to delete/remove the text I draw on the previous bar and then call Draw.TextFixed for the new text? Or will Draw.TextFixed just overwrite whatever text i put there before?

      Second question: suppose I want to draw multiple lines of text. Can I do that just by adding a "\n" character at the end of each line of text? Or is there another way I have to use?

      Comment


        #4
        Hello westofpluto,

        To update it you just need to call the Draw. syntax again with the same tag name. All drawing objects work this way, if a unique tag is provided a new object is made otherwise the existing object will be updated when using the same tag.

        You can use the newline character to add more lines. The alternative to that would be to use an indicator and OnRender, that would allow for using X/Y coordinates to draw text in more custom ways.


        I look forward to being of further assistance.

        JesseNinjaTrader Customer Service

        Comment


          #5
          You can use the newline character to add more lines. The alternative to that would be to use an indicator and OnRender, that would allow for using X/Y coordinates to draw text in more custom ways.
          Is OnRender only called for indicators and not strategies?

          Comment


            #6
            Hello

            OnRender is a common override used in many types, you could do that from a strategy as well if you wanted to.
            https://ninjatrader.com/support/help...htsub=onrender

            Please let me know if I may be of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by wehwerjhwjerre, Today, 05:00 AM
            0 responses
            3 views
            0 likes
            Last Post wehwerjhwjerre  
            Started by patricia70, Today, 04:41 AM
            0 responses
            3 views
            0 likes
            Last Post patricia70  
            Started by morrnel, Yesterday, 09:12 PM
            1 response
            18 views
            0 likes
            Last Post NinjaTrader_Jason  
            Started by 7robert, Yesterday, 04:41 PM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_Jason  
            Started by soon123, Yesterday, 08:07 PM
            0 responses
            13 views
            0 likes
            Last Post soon123
            by soon123
             
            Working...
            X