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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    35 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    13 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    19 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    21 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X