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 crash

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

    indicator crash

    I have an indicator that crashes if I use the same copy of the indicator on multiple charts at once. The "crash" is that the lines on the indicator stop updating.

    I have to use a seperate file copy of my indicator for each chart I want to run in on. Aka I have to use myindicator1.cs for one chart, and myindicator2.cs for another chart. If I use myindicator1.cs on both charts, then the crash happens.

    The code in each *.cs file is identical, except for the declaration lines: "public class myindicator1 : Indicator" and "public class myindicator2 : Indicator" which have to be different.

    I've had this problem for many months now and it's quite repeatable, in fact it repeats every day. I tolerate it, but it sure would be nice to not have to deal with it, because then I could save a template of my chart and use it with every chart. But as it is, I have to manually load that particular indicator to each chart.

    If anyone has encountered a problem like this I'd love to hear any ideas.

    #2
    more info

    I should say, the indicator doesn't actually crash. It keeps running, because I do still get debug messages. But the lines stop updating. I am taking another look at it now which is why I am posting these messages, and if I find out the cause I'll try to remember to come back here and post a report.

    It's not an exception. Because I have all my code completely inside of try and catch statements, with debug messages sent to the debug window in case of any exception. No debug messages appear, so no exceptions are happening in my code. But the lines stop updating nonetheless. Other debug messages still appear though, so the indicator is still running. I'll try to figure it out, but if anyone knows anything please let me know.

    Comment


      #3
      behealed, thanks for the post - I'm not aware of any similiar issues at this time - is there any way I could testdrive this on my end for you? Any log entries you see when this happens? Is this on the latest 6.5.1000.14 release? Thanks
      BertrandNinjaTrader Customer Service

      Comment


        #4
        test

        I ran the same copy of my indicator, aka myindicator1.cs, on 6 charts at once. The first 5 crash, and the 6th one (which I opened last), keeps on updating the lines forever. This seems to be the repeating behavior. Whichever is the last chart that I open the indicator on, that chart keeps working, and any others will stop updating. No exceptions being reported in debug window.

        But as I said, if I use separate *.cs files, then all 6 charts continue to update their lines correctly, even though identical code is in each file. Obviously my code is the cause of this, since all my other indicators do not behave this way. However, the only substantial difference between my code and all other indicators is that I do use some multi-dimensional arrays.

        Comment


          #5
          behealed, thanks unfortunately this does not ring a bell here, good luck on the debugging process...
          BertrandNinjaTrader Customer Service

          Comment


            #6
            This is the 6.5.1000.14 release. No log entries pertaining to said indicator when it happens. A test drive, sorry, can't share the whole thing, maybe answer questions or post some parts of it, but some of the math I can't share.

            Comment


              #7
              last

              I'm gonna give up. Not really worth the trouble to fix, and a fix might not be possible. I'll continue to use it with separate files.

              Perhaps ninjatrader has some kind of thing internally where it isn't keeping the instances of the indicator completely separate when all instances have the same name and filename. So myindicator1.cs on one chart is interfering with myindicator1.cs on another chart.

              Anyway, if this thread goes dead and someone else see this, and you have this same problem, just use separate files and it hopefully will go away. Took me FOREVER in the past (about a year ago) to figure this out, and been working every since.

              Comment


                #8
                Arrays do not pose any problems

                Do not think that there is a problem with instances.... I am experiencing crashes, if

                the data fields become too large (> 0.7 GByte) or if I am using linked charts (4 charts for the same instruments) and try to load them at the same time. NT often hangs, when loading data, and shows the famous data loading popup forever. I experience this in particular,when I am connected to my data provider and try to switch instruments for a linked set of charts. So I have the habit now, to change them one by one.

                Also I put the market analyzer to a different workspace, because I had even more crashes due to inteference of market analyzer and charts loading data.

                I am using an indicator with large arrays, the same indicator on 3 different charts. This indicator has about 200 arrays: out of the 200 there are some multi-dimensional and some larger one-dimensional arrays (540 elements), and this is not causing any problems, at least no more than simple indicators.

                Comment


                  #9
                  For linked charts use the same lookback period

                  Just made a number of tests. When I use 4 linked charts with different lookback periods, while I am connected, and then decide to change the instrument of the linked charts, NinjaTrader 6.5.14 crashes most of the time. The data loading is not properly implemented: the interference of data loaded for charts with different lookback periods causes the crash.

                  NT would possibly be the best program out there, if it did not have these stability issues.

                  The solution is here: Use the same lookback period for all linked intraday charts.

                  This greatly enhances the stability of NinjaTrader, although it slows down the loading, as you will load more data into the short period chart than you need.

                  I really hope that NT7 will be more stable....

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by gravdigaz6, Today, 11:40 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post gravdigaz6  
                  Started by MarianApalaghiei, Today, 10:49 PM
                  3 responses
                  9 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by XXtrader, Today, 11:30 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post XXtrader  
                  Started by love2code2trade, Yesterday, 01:45 PM
                  4 responses
                  28 views
                  0 likes
                  Last Post love2code2trade  
                  Started by funk10101, Today, 09:43 PM
                  0 responses
                  9 views
                  0 likes
                  Last Post funk10101  
                  Working...
                  X