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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    56 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    75 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    38 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    101 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    60 views
    0 likes
    Last Post PaulMohn  
    Working...
    X