Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to Draw.Text on the left side of the chart?

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

    How to Draw.Text on the left side of the chart?

    I have an indicator which draws lines at support/resistance levels. I would like to label these. It is easy to plot text accurately on the right side of the chart, because the location of the current bar is known. I do this in the in first attached image. But I would like to make them appear like the second attached image. That is, always on the far left, no matter how the chart is expanded or compressed. How would I do this not knowing the bar number or bar time of the leftmost bar?
    Attached Files

    #2
    Hello gbourque,

    Thanks for your post.

    SharpDX in OnRender() would need to be used to custom render the text on the left side of the chart window to accomplish your overall goal as seen in the screenshot you shared.

    You could view the documented SampleCustomRender sample script that comes with NinjaTrader to get a good overview of using SharpDX in OnRender() to custom render objects on a chart. To view the script open a New > NinjaScript Editor window, open the Indicators folder, and double-click on the SampleCustomRender file.

    See the help guide documentation below for more information.

    Using SharpDX for Custom Chart Rendering: https://ninjatrader.com/support/help..._rendering.htm
    OnRender(): https://ninjatrader.com/support/help...8/onrender.htm
    RenderTarget.DrawText(): https://ninjatrader.com/support/help...t_drawtext.htm
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    571 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    548 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    549 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X