Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator cause NT8 to freeze due to drawing

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

    Indicator cause NT8 to freeze due to drawing

    Hello,

    I have implemented several indicators, which basically run well.
    However if I want to draw a line on the chart in OnBarUpdate() if certain conditions are met
    e.g.

    Code:
     protected override void OnBarUpdate()
     {
    ...
    if( val1 != 0)
    {
    Draw.Line(this, "Line_" + _id false, 5, val1, 0, val1, Brushes.Green, DashStyleHelper.Solid, 4);
    _id++;
    }
    ...
    }
    very often NT8 freezes.

    Debugging results that the Drawing of the line gets stuck in DrawingTool.GetTagorNew.

    In the attachment you can see that the 24th line causes the freeze.
    Sometimes all line are there and everything is ok, sometime it gets stuck in the xxth line drawing or the xxxth line drawing.
    Attached Files
    Last edited by mafon; 02-05-2018, 05:07 PM.

    #2
    Hello mafon,

    Welcome to the NinjaTrader forums.

    I wanted to check, do you have an export sample that you can provide that demonstrates this freeze? Generally, we would suggest to reduce your code as much as possible to locate the logic causing the freeze and then put that logic in a separate script as a sample. We can review the syntax used and use case to see if we also get the freeze and if so development could take a look at it further.

    I look forward to being of further assistance.

    Comment


      #3
      I've found out that using Draw.xxx alone runs fine.
      However in combination with RemoveDrawObject it causes the freeze.
      See attachments.
      Attached Files

      Comment


        #4
        Hello,

        Thank you for the reply and samples.

        I wanted to check, if you remove the "RemoveDrawObject" syntax from Historical processing specifically, are you able to see your logic otherwise work going forward in Realtime?

        This may be a case where this would be expected or that the paltform has a long delay after the action taken due to resources required for RemoveDrawObject. If the case is that you can see this working normally except in Historical bars after a period of bars, the solution would likely be to wait until State.Transition and do all removals at that point or from that point add what is needed in historical. Going forward in realtime the existing logic should be able to be used.

        Could you test this to see if you get the same result in your test scenario?

        I look forward to being of further assistance.

        Comment


          #5
          I change the indicator and wait till State reaches Transition/Realtime to do the removing.

          It works fine now, Thank you!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          580 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          335 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          102 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          554 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          552 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X