Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IDrawingTool.EndAnchor.SlotIndex not working in Strategy Analyzer

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

    IDrawingTool.EndAnchor.SlotIndex not working in Strategy Analyzer

    Hi,

    I need to draw a horizontal line that starts at a certain bar in the past and ends at the CurrentBar. I've used Draw.Line to draw the line initially, then I am using line.EndAnchor.SlotIndex += 1; to update it to the CurrentBar.

    That works in the Chart, however it does not work properly in the Strategy Analyzer. When debugging, the value of SlotIndex is set to -2147483648, which is Integer.MinValue.

    What is a reliable way to achieve what I am trying to do in both environments?

    Thanks

    #2
    Hello awesometrader,

    Thanks for your post and welcome to the NinjaTrader forums!

    I would recommend saving the start bar into an int variable and then just using that in the Draw.Line() method where you would use the variable name for the start bar, use 0 for the current bar and keep the "tag name" the same so that on each on bar update, the line is automatically removed and redrawn with the new current bar.



    Comment


      #3
      Thanks, that worked!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      69 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      42 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      24 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      27 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      54 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X