Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to Get/Use values from the bar that the chart cursor is hovering over

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

    How to Get/Use values from the bar that the chart cursor is hovering over

    I want to create a kind of "Stop Light" display on my chart using either circles/squares in a fixed location on the chart, which are shaded Green/Yellow/Red based on logic using other indicators. etc. (this part I know how to do that).

    But I want to be able to scroll back in time on the chart with the cursor and have these stop lights change colors based on the bar I am on at any particular crosshairs location. In essence, like the databox displays the information based on the bar you are scrolling over-except I want to shade fixed squares based on the bar I am hovering over.

    I have experimented using text displays (FixedText) - to display text...but they only display the live bar, and I can't scroll back and have the fixed text change.

    Can you suggest a path forward? Or have any examples of this 'behavior' I can model my solution after?

    #2
    Hello EminiTrader, thanks for writing in.

    The best way to do this would be to use SharpDX in the OnRender method. On each OnRender pass you can loop through the visible bars on the chart using the FromIndex and ToIndex and render images on a per-bar basis. See the guide we have here on using OnRender:

    https://ninjatrader.com/support/help..._rendering.htm

    Best regards,
    -ChrisL


    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    156 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    90 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    140 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    130 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    107 views
    0 likes
    Last Post CarlTrading  
    Working...
    X