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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    81 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    66 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X