• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 NinjaCustomer, Today, 03:22 AM
      0 responses
      2 views
      0 likes
      Last Post NinjaCustomer  
      Started by MarianApalaghiei, Today, 01:26 AM
      0 responses
      9 views
      0 likes
      Last Post MarianApalaghiei  
      Started by seagraph, Yesterday, 03:27 PM
      0 responses
      13 views
      0 likes
      Last Post seagraph  
      Started by dedouglas, Yesterday, 02:54 PM
      1 response
      16 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by elkhatabi, 08-01-2019, 06:36 PM
      5 responses
      54 views
      0 likes
      Last Post NinjaTrader_RyanL  
      Working...
      X