Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Write Text on top of Current Unfinished Bar using OnRender

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

    Write Text on top of Current Unfinished Bar using OnRender

    How can I write text using Onrender instead of Onupdate?
    This works on OnUpdate. But I want to do this using Onrender.

    Draw.Text(this, "tag1" + CurrentBar, true, myText.ToString(), 0, High[0] + 5 * TickSize, 0, Brushes.White, textFont, TextAlignment.Center, BrushBlue, BrushBlue, 80);

    Thanks!

    #2
    Hello r3n3v,

    Drawing text in OnRender() requires using SharpDx. Take a look at the code in the DrawingTools > Text (@Text.cs) file that is open source and included with NinjaTrader.

    Also, below is a link to an example that renders text.
    Simple script that adds a background watermark of the instrument symbol (and expiry if a future) to the chart. (Updated July 10th, 2018 ‐ The opacity needed to be casted as a double and divided by 100 to be between 0 and 1) (Update: August 24th, 2021 – Subtracted the ChartPanel.Y so indicator can be […]
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    671 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    379 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    111 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    575 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    582 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X