Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to add text on bar using onrender

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

    How to add text on bar using onrender

    How can I add text per bar using OnRender? Is there a sample available? There is one for OnUpdate.

    #2
    Hello r3n3v,

    Thanks for your post.

    I have attached an example that demonstrates using SharpDX rendering in place of drawing objects to give further direction here. The example uses a Series<bool> to identify if something should be drawn on that bar. Text is also drawn with SharpDX in the example.

    To get more acquainted with SharpDX rendering, please see the Help Guide article below, and please see the SampleCustomRender indicator that comes with NinjaTrader.

    https://ninjatrader.com/support/help..._rendering.htm

    We look forward to assisting.
    Attached Files

    Comment


      #3
      Appreciate your help Jim! I'll check this out!

      Comment


        #4
        I just checked. But what I meant is to Print Text Per bar. I know how to position text on the screen based on chart control.

        Comment


          #5
          Hello r3n3v,

          You can use a Series<bool> to store information that something should be drawn on that bar, and you can use other Series objects or private variables to store what should be drawn. In OnRender, when you loop through visible bars, you would check to see what should be drawn from the Series<bool> and then use information from your custom Series objects, or from a PriceSeries.

          If you do not want to use a Series<bool> to signal which bars should have something drawn, you can simply loop through ChartBars.FromIndex and ChartBars.ToIndex in OnRender, and then draw text for each visible bar. (You can reference data from custom Series<double>'s or from the PriceSeries of the script for what should be drawn.) I.E. You can ignore line 115 where the Series<bool> is checked if something should be drawn.

          We look forward to assisting.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          602 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          347 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          560 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          559 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X