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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      174 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      329 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      252 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      356 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      182 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X