Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator not reloading when reloading ninjascript

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

    Indicator not reloading when reloading ninjascript

    I have an indicator in NT8. (8.0.28.0 64-bit )
    The indicator is designed to draw a horizonal ray at the ATR of the last few candles.
    The indicator works fine as long as the last few candles are displayed on the right side of the chart.
    If I scroll back on the chart and click reload ninjascript I would expect the indicator to redraw the line at the last visible candle.
    It does not but remains at the far right candle even though it is not displayed on the chart.

    In NT7 this was possible and perhaps I have missed a step to refresh the chart in NT8
    Is there a way to activate that funtion in NT8 so I can view where the horizontal ray would be on earlier candles?

    I've attached an image of the indicator showing and not showing on bars 10 minutes earlier than the last bar on the chart
    Attached Files

    #2
    Hello DavidHP,

    Thank you for your post.

    If the ray is being drawn with the Draw.Ray() method, then it has either startBarsAgo/endBarsAgo or startTime/endTime anchors. Typically, when working with only the visible bars on the chart (such as having the ray show on the last candle shown on the right of the chart, even if it is not the actual last candle loaded) you would use OnRender(). In OnRender() you can get the values for ChartBars.FromIndex and ChartBars.ToIndex to get the first and last bars rendered on the chart, for example. OnRender() refreshes as you interact with the chart, so those values will constantly change as you move the chart around, such as scrolling on the x-axis.

    If you still have a NinjaTrader 7 script that you used that behaved as desired, you could consider reviewing the Code Breaking Changes and follow the tips in the forum post linked below to convert the script to NinjaTrader 8:Please let us know if we may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    83 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    47 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    29 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    66 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X