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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    72 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    152 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    100 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    288 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X