Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaScript Output Disappearing After Running Strategy Analyzer

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

    NinjaScript Output Disappearing After Running Strategy Analyzer

    Hello,

    I am testing a strategy using Strategy Analyzer and I have a number of print statements included. After Strategy Analyzer completes, sometimes very quickly, the NinjaScript Output window is automatically cleared.

    Is there any way to stop this from happening or somewhere I can find the Output for the Strategy execution?

    Thank you!

    #2
    Hello vossom,

    Somewhere there may be a script calling ClearOutputWindow() likely somewhere in OnStateChange().


    It might be another script and not this script.

    If you have visual studio installed, you can click the Visual Studio icon on the NinjaScript Editor to launch, and then Ctrl + f to find, and 'Look in' set to 'Current project', searching for ClearOutputWindow, and click Find All. This will list all scripts calling ClearOutputWindow() to help you find the script causing the behavior.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      Nowhere in my strategy is this method called. The only indicators that are used within the strategy are EMA and ATR. I have checked the code for both and neither of these contain this method either.

      The same thing also occurs when reloading a strategy.

      Also if I have an issue with a Strategy and Strategy Analyzer can't run it, the same things happens there as well and I am unable to see the script error message.

      Any other ideas?

      Thank you

      Comment


        #4
        Hello vossom,

        I'm telling you it could be any script.

        All scripts will run OnStateChange() when opening the Strategies or Indicators window, not just the script you are working on.

        May I confirm you have check every single script in NinjaTrader?

        A script that cannot run in the Strategy Analyzer either has an error appearing on the Log tab of the Control Center, doesn't have any data on the Chart, or isn't placing orders due to the logic.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi Chelsea,

          The output is clearing after running a backtest when Strategy Analyzer is already loaded.

          Are you telling me that every single script is executed (initialized) every time I click Run on Strategy Analyzer?

          Thanks,
          Vossom

          Comment


            #6
            Hello Vossom,

            All strategies have an instance created and OnStateChange() run after a backtest, when loading the Strategy Analyzer, etc, because this is used to populate the Strategy drop-down.

            Please confirm you have checked every indicator and every strategy for ClearOutputWindow().
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Thanks for confirming. I did find some other strategies that have this method, so I will clear those out.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Today, 05:17 AM
              0 responses
              53 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              130 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              70 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              44 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              49 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X