Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Code not catching Error

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

    Code not catching Error

    Hey guys, I'm getting a popup "Object reference not set to instance of an Object" I tried using a Try Catch block but that did not catch the error and also checked the log file but am not able to pinpoint the line of code causing it. Any ideas on how to figure out which line? I know it has to do with the number of open positions.

    #2
    Originally posted by elitetradernyc View Post
    Hey guys, I'm getting a popup "Object reference not set to instance of an Object" I tried using a Try Catch block but that did not catch the error and also checked the log file but am not able to pinpoint the line of code causing it. Any ideas on how to figure out which line? I know it has to do with the number of open positions.
    Without using a debugger, you could put a unique print line on each line to see how far the program gets before failure.

    Print ( "1" );
    something;
    Print ( "2" );
    something else;
    Print ( "3" );

    And depending on how big your program is, you could start by splitting off in 4 sections, then work your way down to sections within those sections. (divide and conquer).

    Well, that would be my plan of attack.

    Comment


      #3
      Cool, its weird because I also use CLR Debugger and that didnt catch it either.

      Comment


        #4
        Originally posted by elitetradernyc View Post
        Cool, its weird because I also use CLR Debugger and that didnt catch it either.
        You might want to poke around in these threads also:

        Comment


          #5
          Originally posted by sledge View Post
          You might want to poke around in these threads also:

          http://www.ninjatrader.com/support/f...archid=1471380
          Link goes nowhere.

          Comment


            #6
            Originally posted by koganam View Post
            Link goes nowhere.
            Figures.

            It was just a search result on "Object reference not set to instance of an Object" (WITH QUOTES).

            there were 5 other threads with that in it...

            Without seeing his code, we are in that vacuum once again!

            Comment


              #7
              Originally posted by elitetradernyc View Post
              Hey guys, I'm getting a popup "Object reference not set to instance of an Object" I tried using a Try Catch block but that did not catch the error and also checked the log file but am not able to pinpoint the line of code causing it. Any ideas on how to figure out which line? I know it has to do with the number of open positions.
              As an idea on how to figure it out, I will point you to this other thread that you opened, and where I gave you my shotgun method.

              Comment


                #8
                Hey Koganam, this error is totally different. I think it has to do with the number of positions that my strategy has open at one timewhen I had it at 2 i didnt get the error now ive got 6 at once so somehow that is causing it. I also have CLR debugger installed but for some odd reason thats not catching it this time.

                Comment


                  #9
                  Originally posted by elitetradernyc View Post
                  Hey Koganam, this error is totally different. I think it has to do with the number of positions that my strategy has open at one timewhen I had it at 2 i didnt get the error now ive got 6 at once so somehow that is causing it. I also have CLR debugger installed but for some odd reason thats not catching it this time.
                  I cannot see why that would make a difference, unless the Strategy is not getting stopped by the error? Is the Strategy not getting stopped?
                  Last edited by koganam; 05-28-2013, 09:14 AM.

                  Comment


                    #10
                    Lets see what the NT people say.

                    Comment


                      #11
                      Good luck.


                      Originally posted by elitetradernyc View Post
                      Lets see what the NT people say.

                      Comment


                        #12
                        Hello elitetradernyc,

                        Thank you for your posts and thank you to those that have tried to help out here.

                        Is the strategy getting stopped by the error?

                        In addition, please send me your log and trace files for today so that I may look into what occurred.

                        You can do this by going to the Control Center-> Help-> Mail to Support.

                        Please place 'ATTN: Patrick - 852383' in the subject line and a reference to this thread in the body of the email: http://www.ninjatrader.com/support/f...ad.php?t=58061

                        I look forward to assisting you further.

                        Comment


                          #13
                          I figured it out, it was being caused by ExitLong when there is no related long position in the field for entry name.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                          0 responses
                          646 views
                          0 likes
                          Last Post Geovanny Suaza  
                          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                          0 responses
                          367 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by Mindset, 02-09-2026, 11:44 AM
                          0 responses
                          108 views
                          0 likes
                          Last Post Mindset
                          by Mindset
                           
                          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                          0 responses
                          569 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by RFrosty, 01-28-2026, 06:49 PM
                          0 responses
                          573 views
                          1 like
                          Last Post RFrosty
                          by RFrosty
                           
                          Working...
                          X