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

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 Aviram Y, Today, 05:29 AM
              4 responses
              11 views
              0 likes
              Last Post Aviram Y  
              Started by algospoke, 04-17-2024, 06:40 PM
              3 responses
              26 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by bmartz, 03-12-2024, 06:12 AM
              3 responses
              30 views
              0 likes
              Last Post NinjaTrader_Zachary  
              Started by gentlebenthebear, Today, 01:30 AM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by cls71, Today, 04:45 AM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X