Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JesseNinjaTrader Customer Service

    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.
        JesseNinjaTrader Customer Service

        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 TraderBCL, Today, 04:38 AM
          2 responses
          7 views
          0 likes
          Last Post TraderBCL  
          Started by martin70, 03-24-2023, 04:58 AM
          14 responses
          105 views
          0 likes
          Last Post martin70  
          Started by Radano, 06-10-2021, 01:40 AM
          19 responses
          606 views
          0 likes
          Last Post Radano
          by Radano
           
          Started by KenneGaray, Today, 03:48 AM
          0 responses
          4 views
          0 likes
          Last Post KenneGaray  
          Started by thanajo, 05-04-2021, 02:11 AM
          4 responses
          471 views
          0 likes
          Last Post tradingnasdaqprueba  
          Working...
          X