Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Code not catching Error
Collapse
X
-
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.Tags: None
-
Without using a debugger, you could put a unique print line on each line to see how far the program gets before failure.Originally posted by elitetradernyc View PostHey 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.
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.
-
-
You might want to poke around in these threads also:Originally posted by elitetradernyc View PostCool, its weird because I also use CLR Debugger and that didnt catch it either.
Comment
-
Link goes nowhere.Originally posted by sledge View PostYou might want to poke around in these threads also:
http://www.ninjatrader.com/support/f...archid=1471380
Comment
-
-
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.Originally posted by elitetradernyc View PostHey 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.

Comment
-
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
-
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?Originally posted by elitetradernyc View PostHey 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.Last edited by koganam; 05-28-2013, 09:14 AM.
Comment
-
-
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
-
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
651 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
370 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
109 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
574 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
577 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment