Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Indicator is crashing , but there is no trace.
Collapse
X
-
Indicator is crashing , but there is no trace.
Hi, I have developed an indicator to draw some lines on bar close. It is crashed multiple times today. But I dont see anything on my logs. I have added try/catch block on OnBarUpdate method. Please let me know, if anything else needs to be done to catch the reason for crash. Its is started working after refresh F5 and later it is crashed. This happen more frequently when the market is more volatile.Tags: None
-
Hello nandhumca,
Thanks for your post.
Please try removing the try/catch from the script and then use Visual Studio debugging to see if an exception is caught.
For information about debugging using Visual Studio, see this help guide documentation: https://ninjatrader.com/support/help...tudio+debuggin
If you do not see that an exception is caught after removing the try/catch from the script and debugging with Visual Studio, please clarify the following and send your log and trace files to ninjascriptsupport[AT]ninjatrader.com so we may look into this further.
Is the entire NinjaTrader program crashing? Or, does the indicator just stop plotting on the chart?
Follow the steps below to manually attach your log and trace files to your response.- Open your NinjaTrader folder under, "Documents" (sometimes called, "My Documents")
- Right click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
- Send the 2 compressed folders as attachments to this email.
- Once complete, you can delete these compressed folders.
<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
-
Hello nandhumca,
Thanks for your note.
I understand that by "crashing" you mean that the indicator just stops plotting on the chart.
Since this is not reproducible, instead of debugging using Visual Studio you could debug your script using prints to see what part of the code is causing the indicator to stop plotting on the chart. That way when the behavior does happen, you could study the prints in the Output window to see where in the code this issue is occurring.
In the strategy add prints to the script that print the values of every variable used in every condition in the script along with the time of that bar. Prints will appear in the NinjaScript Output window (New > NinjaScript Output window). When the behavior happens, you could see the last print that occurs in the Output window before the behavior happens. This is likely where the issue with the script is occurring.
Below is a link to a forum post that demonstrates how to use prints to understand behavior.
https://ninjatrader.com/support/foru...121#post791121
Let us know if we may assist further.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
-
Thanks for the input. If there is a issue on script logic, it should be re-producible and fail on the same bar when we do refresh right ? I am asking this to understand better how the print will help to catch the issue when the refresh is not facing the same issue .
Comment
-
Hello nandhumca,
Thanks for your note.
After adding prints to the script, you could test the script using the Playback connection. If you see the behavior occur on a certain bar, you could pause the Playback connection, rewind, and replay the Playback connection. I would expect that this would allow you to reproduce the issue when you see it occur.
Playback Connection - https://ninjatrader.com/support/help...connection.htm
The reason you would use prints at each line is to see if the logic stops running at some point, namely when it stops plotting. When the behavior occurs, you could view the last print that displays in the Output window before the plot stops plotting to see where in your code the script is encountering an issue. It is likely that the line of code after the last print that displays is where the issue is occurring.
Let us know if we may assist further.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
563 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
329 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
547 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
548 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment