Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Random error this morning has now disappeared!

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

    Random error this morning has now disappeared!

    I coded up and use an indicator using a standard System.Collections.Generic.List and I use the List.BinarySearch with my own implementation of a Sorter. This is not ideal but it's the best I could find for my purposes at the moment.

    Today after 3 months without problem suddenly I started getting the following:

    2013-04-26 12:12:16 Default Error on calling 'OnBarUpdate' method for indicator 'PermaCodeSR004' on bar 21: Failed to compare two elements in the array.

    Googling the error lead me to results telling me that I was using it wrong somehow but I couldn't see why.

    It killed my indicator so I had to trade my trading session without it, and now that I'm looking into the problem, it's disappeared.

    I haven't updated .NET recently, nor have I just upgraded to NT7 v13, nor have I made any other changes I can think of.

    Has anybody come across this?

    #2
    Hello adamus,

    Do you have a Try-Catch block around the code when you are calling to help find out what is going on?
    JCNinjaTrader Customer Service

    Comment


      #3
      No, I'm using a whole ream of Print statements and I can't see where it occurs. It doesn't occur anywhere near where I am accessing the List object.

      Comment


        #4
        Hello adamus,

        You may want to place around different Sections of your code and then in each different "catch" block along with printing out the "Exception" you can print out something unique to be able to tell which "try" block is throwing the error to be able to help narrow down what is causing the error.
        JCNinjaTrader Customer Service

        Comment


          #5
          alright I'll try that. One thing that puzzled me in other messages about this error on C# forums is that it was often occuring in higher versions of .NET, like 4.0 and 4.5.

          I have 4.0 on my machine. Which version does NinjaTrader require?

          Comment


            #6
            Hello adamus,

            Thank you for your response.

            NinjaTrader uses .NET 3.5, you must compile and develop any assemblies with .NET 3.5 if you plan to implement them in NinjaTrader.

            Comment


              #7
              So it might be some kind of versioning problem in Windows? Argh. I thought it would give me an error message actually relevant to the problem. I guess that was a bit too optmistic of me to expect of Windows.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Hwop38, 05-04-2026, 07:02 PM
              0 responses
              181 views
              0 likes
              Last Post Hwop38
              by Hwop38
               
              Started by CaptainJack, 04-24-2026, 11:07 PM
              0 responses
              334 views
              0 likes
              Last Post CaptainJack  
              Started by Mindset, 04-21-2026, 06:46 AM
              0 responses
              258 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by M4ndoo, 04-20-2026, 05:21 PM
              0 responses
              358 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Started by M4ndoo, 04-19-2026, 05:54 PM
              0 responses
              187 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Working...
              X