• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.
            Patrick H.NinjaTrader Customer Service

            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 ralett, Today, 06:20 PM
              0 responses
              1 view
              0 likes
              Last Post ralett
              by ralett
               
              Started by grizzlytrader, Today, 06:24 AM
              1 response
              18 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by andrewtrades, Today, 01:43 PM
              1 response
              6 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by FuturesRon, Today, 03:09 AM
              1 response
              18 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Ivantr, Today, 05:24 PM
              0 responses
              5 views
              0 likes
              Last Post Ivantr
              by Ivantr
               
              Working...
              X