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

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 maybeimnotrader, Today, 05:46 PM
                          0 responses
                          6 views
                          0 likes
                          Last Post maybeimnotrader  
                          Started by quantismo, Today, 05:13 PM
                          0 responses
                          6 views
                          0 likes
                          Last Post quantismo  
                          Started by AttiM, 02-14-2024, 05:20 PM
                          8 responses
                          166 views
                          0 likes
                          Last Post jeronymite  
                          Started by cre8able, Today, 04:22 PM
                          0 responses
                          8 views
                          0 likes
                          Last Post cre8able  
                          Started by RichStudent, Today, 04:21 PM
                          0 responses
                          5 views
                          0 likes
                          Last Post RichStudent  
                          Working...
                          X