Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

custom script causing platform crashing

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

    custom script causing platform crashing

    Hi there:
    since this seems to be more of a platform issue than a programming a strategy issue I figured this was the right part of the forum.

    I'm programming a strategy into my NT8 platform and I've been finding that the program frequently slows down a LOT or crashes when my instructions for code get too many or too complex.
    I have a couple of questions about this, how do I optimize NT8 itself? how would I go about identifying unnecessary lurker programs elsewhere on my system that might be interfering with the programming let alone execution of a strategy?

    And what would be an optimum system to have to keep from crashing ever?

    I currently have an Athlon3 480 (4 core) with 32G of ram, a smoking hot graphics card for it's era. but the whole system itself is 5 years old. The system was originally built for graphic design and running Adobe CS5.

    Or. is there something else entirely that I should be looking into that might be causing my program to crash Too many indicators loaded in the library, for example. or perhaps nesting indicators itself causes problems and I should be looking into creating indicators which are "pre nested" so I only call one thing at a time instead of a whole blooming chain of them.

    #2
    Hello Daryl Haaland,

    Broken loops, improper creation of rendering objects, improperly accessing threads, and creating too many objects can cause crashes.

    Part of the power and flexibility of NinjaTrader is allowing users and 3rd party developers to create scripts in C# that run on the NinjaTrader Platform. However, NinjaTrader is not able to prevent code that will improperly execute from being written into a script. Because of this, it is possible for an improperly coded NinjaScript to cause undesired behavior. However, the help guide provides documentation for developers to avoid a large amount of code that can cause issues. Even with these guidelines, it is still possible for the logic of a script to cause undesired behavior.

    From the help guide:

    "NinjaTrader 8 provides a development environment allowing low-level access to 3rd party developers to build integrated indicators, drawing tools, automated strategies and more. An Add-On with software bugs can have adverse effects on the entire NinjaTrader application. These add-ons also natively run on your computer, therefore, its important to only install 3rd Party Add-Ons from sources you trust.

    The following symptoms post installation could indicate an Add-On is installed causing negative impact:
    • Windows become slow or unresponsive to user interaction
    • Market data becomes unusually slow to load or update
    • Standard features fail to work as designed
    • Lost connections from market data providers
    • Error messages are generated at various times
    • The entire application shuts down abruptly and without warning"


    Below is a publicly available link to the help guide.
    http://ninjatrader.com/support/helpG...tallingAdd-Ons

    An analogy for a platform would be Microsoft Windows. Like NinjaTrader, Microsoft creates the Windows platform that allows other developers to write and execute their own programs within. However, it is not possible for Microsoft to prevent developers from writing applications with improperly written or designed code. It is possible for a developer to write a program that can cause adverse behavior within the program, but also affect the entire Windows operating system and cause performance issues or even crash the entire operating system platform.

    In the same way, while we strive for excellence within our own platform and work to continuously improve our product, it is not possible for NinjaTrader to allow for the power and flexibility of NinjaScripts and also prevent scripts from having the ability to cause undesired behavior with performance or crashing.

    That said, if we can demonstrate that there is an issue directly with the NinjaTrader Platform by creating sample scripts that only contain the bare-bones minimum code to reproduce the behavior, we are able to report these issues to our development for correction.


    To prevent a script from causing NinjaTrader to crash, the script would need to be free of logical errors that can cause a crash.

    It is unlikely the amount of scripts that are imported in the system specifically will cause NinjaTrader to crash.
    However, if within the open workspaces if there are a great many instances of indicators added and are currently running on charts and the memory runs out, then there is a possibility of a crash. More likely, the system would start page filing and would just run very slow.

    I would recommend identifying what is causing the crash. Close all workspaces and open a new blank workspace and add only a single indicator that is able to cause the behavior.
    Then debug the script by commenting out code until the behavior stops, and then un-comment code until the error returns to identify what is causing the issue.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      After a long slowly draw out "Ahhhhhh Haaaaa". While reading your reply, your solution makes a whole lot of sense. I shall do exactly that. I'll keep you posted.

      Originally posted by NinjaTrader_ChelseaB View Post
      Hello Daryl Haaland,

      Broken loops, improper creation of rendering objects, improperly accessing threads, and creating too many objects can cause crashes.

      Part of the power and flexibility of NinjaTrader is allowing users and 3rd party developers to create scripts in C# that run on the NinjaTrader Platform. However, NinjaTrader is not able to prevent code that will improperly execute from being written into a script. Because of this, it is possible for an improperly coded NinjaScript to cause undesired behavior. However, the help guide provides documentation for developers to avoid a large amount of code that can cause issues. Even with these guidelines, it is still possible for the logic of a script to cause undesired behavior.

      From the help guide:

      "NinjaTrader 8 provides a development environment allowing low-level access to 3rd party developers to build integrated indicators, drawing tools, automated strategies and more. An Add-On with software bugs can have adverse effects on the entire NinjaTrader application. These add-ons also natively run on your computer, therefore, its important to only install 3rd Party Add-Ons from sources you trust.

      The following symptoms post installation could indicate an Add-On is installed causing negative impact:
      • Windows become slow or unresponsive to user interaction
      • Market data becomes unusually slow to load or update
      • Standard features fail to work as designed
      • Lost connections from market data providers
      • Error messages are generated at various times
      • The entire application shuts down abruptly and without warning"


      Below is a publicly available link to the help guide.


      An analogy for a platform would be Microsoft Windows. Like NinjaTrader, Microsoft creates the Windows platform that allows other developers to write and execute their own programs within. However, it is not possible for Microsoft to prevent developers from writing applications with improperly written or designed code. It is possible for a developer to write a program that can cause adverse behavior within the program, but also affect the entire Windows operating system and cause performance issues or even crash the entire operating system platform.

      In the same way, while we strive for excellence within our own platform and work to continuously improve our product, it is not possible for NinjaTrader to allow for the power and flexibility of NinjaScripts and also prevent scripts from having the ability to cause undesired behavior with performance or crashing.

      That said, if we can demonstrate that there is an issue directly with the NinjaTrader Platform by creating sample scripts that only contain the bare-bones minimum code to reproduce the behavior, we are able to report these issues to our development for correction.


      To prevent a script from causing NinjaTrader to crash, the script would need to be free of logical errors that can cause a crash.

      It is unlikely the amount of scripts that are imported in the system specifically will cause NinjaTrader to crash.
      However, if within the open workspaces if there are a great many instances of indicators added and are currently running on charts and the memory runs out, then there is a possibility of a crash. More likely, the system would start page filing and would just run very slow.

      I would recommend identifying what is causing the crash. Close all workspaces and open a new blank workspace and add only a single indicator that is able to cause the behavior.
      Then debug the script by commenting out code until the behavior stops, and then un-comment code until the error returns to identify what is causing the issue.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bortz, 11-06-2023, 08:04 AM
      47 responses
      1,610 views
      0 likes
      Last Post aligator  
      Started by jaybedreamin, Today, 05:56 PM
      0 responses
      9 views
      0 likes
      Last Post jaybedreamin  
      Started by DJ888, 04-16-2024, 06:09 PM
      6 responses
      19 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      6 views
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      16 views
      0 likes
      Last Post Javierw.ok  
      Working...
      X