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 stops updating sometimes

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

    Indicator stops updating sometimes

    The following code stops plotting to the chart all the time when running on intraday data and updating every tick. If I format the indicators it will update but it will stop again after awhile. When it stops updating the plot to the chart, I believe it also does not alert but it does continually update the number at the right of the screen.

    {
    if (CurrentBar < 4)
    return;
    if (Bars.PercentComplete>0)
    {
    Plot0.Set(Volume[0] /Bars.PercentComplete);
    }


    if (Volume[0] /Bars.PercentComplete > 1.2 *Volume[1])
    {
    if (alarmOn ==1)
    {
    Alert("myAlert", NinjaTrader.Cbi.Priority.High, "PRV", "Alert1.wav", 90, Color.Black, Color.Yellow);
    }
    }

    }

    #2
    If an indicator stop working you will see an error message in the log of the Control Center window with some idea of the error being generated. If the indicator stops plotting, you will have to do some further debugging to see why the Plot0.Set() method is not being called...or what value is actually being set.
    RayNinjaTrader Customer Service

    Comment


      #3
      I already solved this one a couple of weeks ago. I'd bet you're still getting a divide by zero.

      See: http://www.ninjatrader-support.com/v...ead.php?t=3761

      Comment


        #4
        Shoot, I protected it against divide by zero in the first part of the code but not in the alert part... thanks...
        Last edited by maxpi; 11-09-2007, 11:31 AM.

        Comment


          #5
          Even after getting all the divide by zero problems out of the code it still stopped plotting exactly the same. I had to move the plot0 statement so it was not dependent on the Bars.PercentComplete>0 condition, now it seems to run all the time like it should.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by bortz, 11-06-2023, 08:04 AM
          47 responses
          1,605 views
          0 likes
          Last Post aligator  
          Started by jaybedreamin, Today, 05:56 PM
          0 responses
          8 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          18 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          4 views
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          13 views
          0 likes
          Last Post Javierw.ok  
          Working...
          X