No announcement yet.

Partner 728x90


Strategy Analyzer Unstable

  • Filter
  • Time
  • Show
Clear All
new posts

    Strategy Analyzer Unstable

    Intermittently, the Strategy Analyzer will crash the entire platform.

    This is extremely frustrating as nothing changes between strategy runs.
    I'll test my strategy once it works fine. I run it again immediately after and it crashes the entire application.

    How can I determine what is causing this issue?
    I'm running 64-bit (Multi-Broker), using the "unmanaged" approach.

    (As a side note, an application should NEVER be released to the public with unhandled exceptions causing the entire platform to crash!)

    Hello Mark,

    Thank you for your note.

    Are you able to reproduce this behavior using the SampleMACrossOver script included with NinjaTrader?

    If you open the Windows TaskManager are you finding that the memory amount for the NinjaTrader process is increasing by a large amount when running the backtest?

    Below is a link to an example script named . Are you able to reproduce using this example?

    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"

    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.

    I look forward to your reply.


      Thanks for the quick reply Patrick! I'll start doing some additional research and let you know what I discover.

      The strategy I'm creating is somewhat complex so I will have to wrench on it a bit to see if I can narrow things down. It has the following features, any of which could be the culprit either due to an error on my end or a previously undiscovered bug within the platform.

      - Unmanaged orders
      - Ability to read indicator output from another timeframe (i.e. a call to AddDataSeries())
      - Visual drawing elements (Dots, triangles, etc. to provide visual cues)
      - Trade management which will cancel/move orders as needed.

      I understand what you mean about not being able to handle user-driven errors being that they can code whatever they want. I've been a professional software developer for 20+ years and we have a saying: "Writing software would be great if it weren't for the customers."

      I'll keep you posted.


        -- UPDATE --

        So, after quite a bit of troubleshooting and trial & error, I think I figured out what is happening here.

        We do all of our development in Visual Studio. And for some reason, it seems that the compiled binaries between NT and VS become out of sync after lots of changes have occurred. It's almost as if there is a lag between the NT compiler and what Visual Studio creates.

        However, what has been working for us is to simply shut down/exit NinjaTrader, and then clean the entire solution. Do a rebuild of everything, and then re-launch NinjaTrader. Things seem to work fine after that.

        Hopefully this may help someone with a similar issue.


        Latest Posts


        Topics Statistics Last Post
        Started by op1031, Yesterday, 05:51 PM
        1 response
        Last Post NinjaTrader_PaulH  
        Started by aaadetos, 05-04-2021, 09:28 AM
        1 response
        Last Post Lancer
        by Lancer
        Started by Stanfillirenfro, Today, 04:34 AM
        1 response
        Last Post Stanfillirenfro  
        Started by Impeesa, Today, 04:31 AM
        0 responses
        Last Post Impeesa
        by Impeesa
        Started by knarfoe, Today, 03:41 AM
        1 response
        Last Post NinjaTrader_Jason