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

Failed to execute StrategyUpdateJob

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

    Failed to execute StrategyUpdateJob

    "Out of the blue" I now receive the following error on starting a strategy I am developing:

    Failed to execute DB job 'StrategyUpdateJob': There was an error generating the XML document.: Timeouts are not supported on this stream.
    What does this mean, and what is likely to be causing it?

    It occurs on Sim101. I have reset the Simulator (including removing historical data), restarted NT7 and the error still happens.

    Thanks.
    Multi-Dimensional Managed Trading
    jeronymite
    NinjaTrader Ecosystem Vendor - Mizpah Software

    #2
    Hello,

    This error can occur when something has gone wrong with the database. You should be able to resolve this by resetting your database (Tools > Options > Data Tab > "Reset DB"). For more information, please see the post below:

    http://www.ninjatrader.com/support/f...ad.php?t=52998

    Please let me know if I can assist further.
    Dave I.NinjaTrader Product Management

    Comment


      #3
      Still get Failed to execute StrategyUpdateJob Error

      Thanks, Dave.

      Unfortunately, that did not resolve the issue. (Reset DB followed by restart.)

      Your further recommendations appreciated. Thanks.
      Multi-Dimensional Managed Trading
      jeronymite
      NinjaTrader Ecosystem Vendor - Mizpah Software

      Comment


        #4
        That is interesting. Does the same thing occur if you close NinjaTrader, then rename the "ninjatrader.sdf" file located in the C:\Users\<username>\Documents\NinjaTrader 7\db folder on your PC, then restart NinjaTrader?
        Dave I.NinjaTrader Product Management

        Comment


          #5
          Still get Failed to execute StrategyUpdateJob Error

          Yes, it does.

          By way of extra information, it nearly always produces two popups of the same message. This has been the case all along. In some earlier cases it produced more than two.

          On one earlier occasion, it also produced the same type of error, but instead of "Timeouts ...", it had "Cannot access a closed file." ... but that was just on one occasion.

          Your ideas most appreciated! Thanks.
          Multi-Dimensional Managed Trading
          jeronymite
          NinjaTrader Ecosystem Vendor - Mizpah Software

          Comment


            #6
            Hello,

            Are you seeing any files in the C:\Users\<username>\Documents\NinjaTrader 7\templates\Strategy folder on your PC? If so, please try either deleting those files, or moving them out of that folder (to your desktop, perhaps), and see if the issue still occurs.
            Dave I.NinjaTrader Product Management

            Comment


              #7
              Still get Failed to execute StrategyUpdateJob Error

              No templates in any of the folders.
              Multi-Dimensional Managed Trading
              jeronymite
              NinjaTrader Ecosystem Vendor - Mizpah Software

              Comment


                #8
                Still get Failed to execute StrategyUpdateJob Error

                So, to make sure all is as fresh as possible, I did the following:
                • Uninstalled NT7
                • Deleted the residual folders structures
                • Reinstalled (latest version)
                • Recreated and re-compiled all strategy code
                • Ran the strategy where the error manifests ...
                • ... and the error still occurs!

                That being so, it does seem to be strategy related, rather than (or as well as) configuration related. I have sent the trace and log files to support.

                Hoping you may be able to discern what is happening.

                It would be most helpful to know what causes the error, so I can see if I can recognise anything in the strategy code that may be potentially causal.

                Thanks!
                Multi-Dimensional Managed Trading
                jeronymite
                NinjaTrader Ecosystem Vendor - Mizpah Software

                Comment


                  #9
                  That is interesting. If you started fresh with a completely new NinjaTrader 7 folder in your Documents folder, then your strategy should not have been included in the new installation. There should also not be anything that you could do in your code to cause this kind of database error. Based on everything we've seen, you may actually need to reinstall or update SQL Compact, the framework that manages the database.

                  Please follow the below steps to ensure the correct version of SQL Compact Edition is installed on your PC.
                  • Navigate to the Windows Control Panel
                  • Add and remove software/programs
                  • Uninstall any SQL Compact Editions you see, if none are present you may ignore this step and continue onto the next step
                  • Install latest SQL Compact Edition 3.5. SP2 which is available here: Download Here
                  • Once you run the downloaded file it will ask you for a directory to extract the installer to. Point this to a temporary directory that you will be able to quickly locate later, such as the desktop
                  • Navigate to the aforementioned directory in which the files have been extracted to
                  • Run the file names SSCERuntime-ENU.exe in which you will want to extract to this directory once more (there will be two files)
                  • SSCERuntime_x86-ENU.msi - Run this one first
                  • SSCERuntime_x64-ENU.msi - No need to run this if you are on a 32 bit system, if you are on a 64 bit system you will also need to run this file, if you are not sure if you have a 64 bit system go ahead and run this file. If you are not using a 64 Bit operating system, the installer will cancel itself automatically
                  • Follow the installation steps outlined in the installation wizard
                  • Once installed you will need to restart your PC


                  We'll figure this one out yet, one way or another.
                  Dave I.NinjaTrader Product Management

                  Comment


                    #10
                    Still get Failed to execute StrategyUpdateJob Error

                    Thanks for your time to investigate this issue, Dave -- very much appreciated!

                    I have followed the instructions to install SQL Compact Edition 3.5. SP2, including a reboot. When running the strategy, the error occurred again, so I reset both the Simulator and the DB, closed and restarted NT ... and the error is still there, sadly.

                    Thanks for your further advice and guidance to get to the root of this and fix it.
                    Multi-Dimensional Managed Trading
                    jeronymite
                    NinjaTrader Ecosystem Vendor - Mizpah Software

                    Comment


                      #11
                      Would you be willing to share the strategy with me, so that I can test on my end and see if the same thing happens? If so, please send a full export (File > Utilities > Export NinjaScript) to platformsupport [at] ninjatrader [dot] com, and reference ticket # 1311234.
                      Dave I.NinjaTrader Product Management

                      Comment


                        #12
                        Still get Failed to execute StrategyUpdateJob Error

                        In principle, yes. ... In practice, the strategy is about 25,000 lines of code ... so not really practical.

                        If you can help me understand the nature and detailed characteristics of the error, that will help me reduce the code down to (potentially) a small repeatable example or a case that identifies the issue clearly.

                        Thanks again.
                        Multi-Dimensional Managed Trading
                        jeronymite
                        NinjaTrader Ecosystem Vendor - Mizpah Software

                        Comment


                          #13
                          Still get Failed to execute StrategyUpdateJob Error

                          Progress!

                          I have been able to create a small code example that demonstrates the error.

                          Here it is:

                          Code:
                          using System;
                          using System.ComponentModel;
                          using System.Diagnostics;
                          using System.Drawing;
                          using System.Drawing.Drawing2D;
                          using System.IO ;
                          using System.Xml.Serialization;
                          using NinjaTrader.Cbi;
                          using NinjaTrader.Data;
                          using NinjaTrader.Indicator;
                          using NinjaTrader.Gui.Chart;
                          using NinjaTrader.Strategy;
                          
                          namespace NinjaTrader.Strategy
                          {
                              [Description("ERROR EXAMPLE")]
                              public class ERROREXAMPLE : Strategy
                              {
                                  public FileStream   fsStatusBox = null ; // When public --> ERROR. When private --> NO ERROR.
                                  public StreamReader srStatusBox = null ; // When public --> ERROR. When private --> NO ERROR.
                          
                                  protected override void Initialize()
                                  {
                                      string AppdataRoaming = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) ; // From Windows
                                      string JTMAppFolder   = Path.Combine(AppdataRoaming,@"NinjaTrader\JTM") ;
                                      string StatusInfoFile = Path.Combine(JTMAppFolder,@"StrategyInfo\") + "Empty.rtf" ;
                                      
                                      if (fsStatusBox == null)
                                          if (File.Exists(StatusInfoFile))
                                          {
                                              fsStatusBox = new FileStream(StatusInfoFile,
                                                                           FileMode.Open,
                                                                           FileAccess.ReadWrite,
                                                                           FileShare.ReadWrite) ;
                                              srStatusBox = new StreamReader(fsStatusBox) ;
                                          }
                                  }
                              }
                          }
                          Note that the file being read can be an empty file -- whether it contains valid RTF or not is irrelevant.

                          The basic issue appears to be in the declarations of the FileStream and StreamReader. If declared private, no error. If declared public, the ERROR occurs.

                          Simple solution, one might say: make them private.

                          Not so simple. The declarations are in another source file within a partial class Strategy where they essentially need to be.

                          So, two questions:
                          1. Why, after a significant period of time where these public declarations had been working perfectly well, should this suddenly produce this error?
                          2. How to fix it so the public declarations remain?

                          Many thanks!
                          Multi-Dimensional Managed Trading
                          jeronymite
                          NinjaTrader Ecosystem Vendor - Mizpah Software

                          Comment


                            #14
                            Hello,

                            Thank you for creating that sample. A few of us have tested the code on our end, and we are not receiving any errors. Everything seems to be working well. Is there anything else you can think of that we would need to do to get the error to appear? Can you give the steps that you use, as precisely as possible?
                            Dave I.NinjaTrader Product Management

                            Comment


                              #15
                              Still get Failed to execute StrategyUpdateJob Error

                              Thanks, Dave, to you and the team, for your assistance.

                              Let me see if I can discover anything additional that may be required and let you know.
                              Multi-Dimensional Managed Trading
                              jeronymite
                              NinjaTrader Ecosystem Vendor - Mizpah Software

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by cre8able, Today, 01:16 PM
                              2 responses
                              9 views
                              0 likes
                              Last Post cre8able  
                              Started by chbruno, 04-24-2024, 04:10 PM
                              3 responses
                              48 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by samish18, Today, 01:01 PM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_LuisH  
                              Started by WHICKED, Today, 12:56 PM
                              1 response
                              9 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by WHICKED, Today, 12:45 PM
                              1 response
                              11 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Working...
                              X