Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawTextFixed

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

    #16
    Hello Matheusfx,

    Thanks for your post.

    In NinjaTrader7 it would be possible through the Plot Override method to draw text on the chart. Regrettably in NinjaTrader7, this method override is not documented so I cannot provide examples. You could look at the example indicator "CustomPlotSample" in your NinjaTrader which provide code examples and comments on what the sections do.

    Comment


      #17
      Originally posted by NinjaTrader_PaulH View Post
      Hello Matheusfx,

      Thanks for your post.

      In NinjaTrader7 it would be possible through the Plot Override method to draw text on the chart. Regrettably in NinjaTrader7, this method override is not documented so I cannot provide examples. You could look at the example indicator "CustomPlotSample" in your NinjaTrader which provide code examples and comments on what the sections do.
      What about NT8?

      Comment


        #18
        Hello Matheusfx,

        Thanks for your reply.

        In NinjaTrader8 you could use the OnRender() method which is well documented in the help guide.

        If you have further NinjaTrader8 questions, please create a new forum topic under NinjaTrader8 as this thread is a NinjaTrader7 forum.

        Comment


          #19
          I needed this for my system today, so just sharing a code snipper if someone is looking for a simple "one liner". It only has one flaw - wide bottom margin just to offset it from the other text. But I found it convenient just to use a single Draw.TextFixed() statement and organize everything in it.

          Code:
                      Draw.TextFixed(this, "Labels",
                      "EMA1 = " + (EMA1[0]) +
                      "\nEMA2 = " + (EMA2[0]) +
                      "\nEMA3 = " + (EMA3[0]) +
                      "\n",
                      TextPosition.BottomLeft,
                      ChartControl.Properties.ChartText,
                      ChartControl.Properties.LabelFont, Brushes.Black, Brushes.Black, 50);​
          this is what it looks like on the chart:
          Click image for larger version

Name:	Screenshot 2023-11-01 125542.png
Views:	243
Size:	9.3 KB
ID:	1275897
          xcoder
          NinjaTrader Ecosystem Vendor - EMS

          Comment


            #20
            @Xcoder

            I can't thank you enough for this tip you freely gave, this is what helped me break through that iron wall lol. Here's my pic what I accomplished.

            Click image for larger version  Name:	2024-12-13 11_46_26-NinjaScript Editor - Indicator - DrawTextfixedexample.png Views:	0 Size:	57.2 KB ID:	1327708
            PS. I was that someone
            "if someone is looking for a simple "one liner"
            Last edited by trdninstyle; 12-13-2024, 10:54 AM.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            574 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            333 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            553 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            551 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X