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

Error Line Code Number

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

    Error Line Code Number

    Hello

    On my strategy when an error is thrown I catch it and print it using Exception.ToString().
    When it happans the method gives me the number of the code line in which the error was thrown. For example:

    at NinjaTrader.Strategy.MyStrategy.MyFunction() in c:\Users\MyUser\Documents\NinjaTrader 7\bin\Custom\Strategy\MyStrategy.cs:line 8624

    However, I've installed my strategy on a new computer and on my new computer I cannot see the line number anymore (the "Debug Mode" value on the code editor is checked.

    How can I see the line number on my new computer as well?

    Thanks

    #2
    Hello,

    Thank you for the question.

    I wanted to check, have you tried creating a sample script for testing and just thrown an Exception to ensure that is working?

    I tried the following:

    Code:
    try
    {
    	throw new Exception("Test Exception", new Exception());
    } catch(Exception e)
    {
    	Print(e.ToString());	
    }


    which produced

    System.Exception: Test Exception ---> System.Exception: Exception of type 'System.Exception' was thrown.
    --- End of inner exception stack trace ---
    at NinjaTrader.Indicator.TEst.OnBarUpdate() in TEst.cs:line 44
    It does look like this is toggled with Debug mode, Have you also tried Unchecking Debug mode, Compile, Check debug mode, Compile and then re run the test?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by briansaul, Today, 05:31 AM
    0 responses
    1 view
    0 likes
    Last Post briansaul  
    Started by fwendolynlpxz, Today, 05:19 AM
    0 responses
    4 views
    0 likes
    Last Post fwendolynlpxz  
    Started by traderqz, Yesterday, 12:06 AM
    11 responses
    28 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by PaulMohn, Today, 03:49 AM
    0 responses
    8 views
    0 likes
    Last Post PaulMohn  
    Started by inanazsocial, Today, 01:15 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Jason  
    Working...
    X