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.



    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks, that worked!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Waxavi, Today, 02:00 AM
      0 responses
      1 view
      0 likes
      Last Post Waxavi
      by Waxavi
       
      Started by elirion, Today, 01:36 AM
      0 responses
      3 views
      0 likes
      Last Post elirion
      by elirion
       
      Started by gentlebenthebear, Today, 01:30 AM
      0 responses
      4 views
      0 likes
      Last Post gentlebenthebear  
      Started by samish18, Yesterday, 08:31 AM
      2 responses
      9 views
      0 likes
      Last Post elirion
      by elirion
       
      Started by Mestor, 03-10-2023, 01:50 AM
      16 responses
      391 views
      0 likes
      Last Post z.franck  
      Working...
      X