Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error in XML-document

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

    Error in XML-document

    Hi!
    Since yesterday I get the error messeage below when runing the strategy analyser and also on start up of NT. What can I do to fix this? (I have used the strategy analyzer a lot recently.)

    Trace log:
    Code:
    2010-04-28 16:11:35:625 ERROR: Strategy b2b1643981134f3c9d92e3446123c588: unable to deserialize user data: There is an error in XML-document (1, 13724).
    2010-04-28 16:11:35:828 ERROR: Strategy d3dd6b93f2764d4b8042ae736c24d2c6: unable to deserialize user data: There is an error in XML-document (1, 13728).
    2010-04-28 16:11:36:046 ERROR: Strategy 5b668abd42d8467e926dc48a24bb53c6: unable to deserialize user data: There is an error in XML-document (1, 13722).
    2010-04-28 16:11:36:375 ERROR: Strategy 4a404ae03de24ae48000fc5e749e203c: unable to deserialize user data: There is an error in XML-document (1, 13635).
    2010-04-28 16:11:36:500 ERROR: Strategy e5f95896a9b64629a5d215fd93ff0679: unable to deserialize user data: There is an error in XML-document (1, 13710).
    2010-04-28 16:11:36:687 ERROR: Strategy 936821cb1c8a41f0bcc31bc4daf20be2: unable to deserialize user data: There is an error in XML-document (1, 13699).
    2010-04-28 16:11:36:812 ERROR: Strategy b882ec660e2a43d4a45878983f6d04ba: unable to deserialize user data: There is an error in XML-document (1, 13723).
    /Regards

    #2
    poseidon_sthlm, are all the properties you use serialized properly?

    Here's an example -



    Do you get this as well for a clean workspace running for example only our SampleMACrossOver strategy?

    Thanks
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks for your prompt reply.

      The error message now only appears on start up of NT. But when I run the strategy analyzer for my main strategy, the backtest quits without any error message after just a few days period instead of the chosen period of several month. This problem does not appear for the SampleMACrossOver Strategy.

      The main strategy (that probably is referenced by the error message) uses an advanced computational intensive indicator. This indicator has two Color parameters that are properly serialized. Are there any other properties than Color that should be "serialized"? This custom indicator uses additional Color variables that are not input parameters. It also has custom methods that return a Color variable. Do these Color variables have to be handeled differently in NT7 than NT6.5?

      (The custom indicator that I mention is created by a very exeprienced programmer. The code seems very well structured and smart. And it did work without any problems in NT 6.5. )

      The error message below references a XML-document. Is it possible to look in the XML document and see what the problem might be? Where can I find this XML- document?

      Any suggestions on how to continue trouble shooting?

      /Regards
      Last edited by poseidon_sthlm; 04-28-2010, 05:40 PM.

      Comment


        #4
        poseidon_sthlm, to troubleshoot this it would help if you could post the properties region of the custom indicator(s) you mention. Thanks.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Hi!
          I really appreciate that you are willing to take your time and have a look at my indicator.

          Since I was unpatient to get on with my strategie development I have restored my database to an older version from before this XML problem occured. The XML-error no longer appears. But I suppose the errors will come back soon since the original source of this problem still isn't fixed. I have discovered that I get error messages when I try to export my NT scripts with File/ Utilities/ Export NT script, although no error messages appear when I compile my NT scripts. These error messages still remain after the restore of the older database. I can't see the resaon for these error messages. One of the error messages says:

          " Error compiling export sources: c:\ dokument\NinjaTrader 7\bin\Custom\Indicator\MyUserDefinedIndicatorMetho ds.cs(29,21) : error CS0118: NinjaTrader.Indicator.SMA is a type but is used as a variable"

          The referenced code is from my custom indicator methods
          Code:
          // Mean Absolut Devaiation (A more efficient dispersion metric when the distribution is not perfectly normal)
                  public double MAD(IDataSeries inputData, int period)
                  { 
                      double average = [B]SMA(inputData, period)[0][/B];
                      double sumOfAbsDiff = 0;
                      
                      for (int i = 0; i < period; i++)
                          {
                              sumOfAbsDiff = sumOfAbsDiff + Math.Abs(average - inputData[i]);
                          }
                          
                      return sumOfAbsDiff/ period;            
                  }
          /Regards
          Last edited by poseidon_sthlm; 04-29-2010, 11:23 AM.

          Comment


            #6
            poseidon_sthlm,

            It is not clear to us from the snippets alone. Can you please attach the whole indicator? Thank you.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              I have sent an email to: "support at ninjatrader dot com" with the Subject: "att. NinjaTrader Josh, NT7 thread 'Error in XML document' " with the indicator attached.

              The XML problem did appear again on the first run of the strategy analyzer after I had restored my database .


              I want to clarify that the first code snippet in my previous post don't references the custom indicator I have mentioned and emailed to you. The first code snippet below is just on of about 5 error messages that appeared when I tried to export all my ninjascripts before restoring my database. I thought that this may be related to the XML-problem or maybe is a sign of a corrupt databse. But I'm not sure wether this is relevant for my XML-problem or not.


              /Regards
              Last edited by poseidon_sthlm; 04-29-2010, 11:24 AM.

              Comment


                #8
                poseidon_sthlm, we just replied to the note you sent in to support...unfortunately we could not reproduce here. To iron out the DB issues, just rename your current one to start with a fresh SDF on next NT restart...you can always move back to your previous DB the same way (by renaming the original one back to NinjaTrader.SDF).

                Or you just retry the same setup and DB on the just released beta 15.

                Thanks
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Hi!
                  I would like to report some observations that I'v made that I think may be related to the XML-probelm.

                  I'v examined my strategy one more time and I think that I'm dealing with two different problems that may be indpendent. The first problem is the "Out of memory exeception" that may be related to the computational intensive indicator that I have mentioned before. The seccond problem is the "Error in XML-document" - problem that I had in NT7b14. This error message dissapeared from my log after a completly clean reinstall of NT7b15 and didn't turn up again when running the strategy analyser.

                  I sometimes do copy a strategy. When copying I open the strategy in the NT script editor and simply right click and choose "save" and then save the strategy under a new name. But I now have got another error message on start up of NT.

                  The new error message says:
                  Code:
                  Unable to restore strategy 'NinjaTrader.Strategy.MyStrategyBacktest' with ID '10d0036ccd8c4c1497876346d350d0a6'. Most likely this strategy no longer is supported by the custom assemblies.
                  Unable to restore strategy 'NinjaTrader.Strategy.MyStrategyBacktest' with ID '619487b59bc446dc859db9c64d43e5e6'. Most likely this strategy no longer is supported by the custom assemblies.
                  The error message above does refer to the old strategy that I copied. This strategy does not exist any more since I have deleted it. How can I get rid of this error message?

                  Another observation that I have made in NT7b14 and NT7b15 during editing my startegies is that old error messages sometimes turn up again (in the editor) that refer to old code that already is corrected and compiled. This feels rather suspicious since the code that the error message referers to no longer exists in my script. So the old faulty code that the error message refers to must be "cached" somewhere else. Where does it come from? (Is it it stored in an XML file maybe)?

                  /Regards

                  Comment


                    #10
                    Thanks for reporting back, great the XML serialize issues have not surfaced again for you, for the error message have you tried a recompile and restart of your scripts so the custom assembly could get updated?

                    Does it happen reproducibly for your NS code editor observations?

                    You could try going with a clean cache (Documents\NinjaTrader 7\cache).
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      I have restored a previous backup file and the error measseg is now gone.

                      Concerning the faulty error messages in the editor I can't say that they are reproducible. I belive that they disapeared after a restart of NT.

                      /Regards

                      Comment


                        #12
                        poseidon_sthlm,

                        Sounds like it may have been trying to use a strategy that simply didn't exist in its old form anymore. Restoring either restored the strategy or got it to a state that did not use it.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          I have a similar error on a NT 6.5 installation that usually runs TT feed, but am doing some testing with history with just IQFeed with it today. Here's context of trace logs:

                          Code:
                          2010-07-13 13:06:26:301 (IQFeed) Dtn.Adapter.Connect: iqPath='C:\Program Files (x86)\DTN\IQFeed'
                          2010-07-13 13:06:29:374 (IQFeed) Cbi.Connection.ConnectNow9 ok
                          2010-07-13 13:06:29:374 (IQFeed) Cbi.ConnectionStatusEventArgs.Process: Connecting Connecting
                          2010-07-13 13:06:29:390 (IQFeed) Dtn.Adapter.MouseMove
                          2010-07-13 13:06:29:390 (IQFeed) Dtn.Adapter.TryConnect0
                          2010-07-13 13:06:29:421 (IQFeed) Dtn.Adapter.TryConnect1: S,KEY,2977
                          2010-07-13 13:06:29:421 (IQFeed) Dtn.Adapter.TryConnect1: S,SERVER CONNECTED
                          2010-07-13 13:06:29:421 (IQFeed) Dtn.Adapter.TryConnect1: S,IP,66.112.156.181 60004,66.112.156.210 60002,66.112.156.211 60009,66.112.156.210 60001,66.112.156.213 60005,66.112.156.210 60012,66.112.156.200 60003,66.112.156.214 60015,66.112.156.211 60050,66.112.156.210 60014,66.112.156.212 60016,66.112.156.210 60018
                          2010-07-13 13:06:29:421 (IQFeed) Dtn.Adapter.TryConnect1: S,CUST,real_time,66.112.156.112,60002,dxuVICnjSkF9UC,4.7.0.9,0,INDEX DTNNEWS SCROLLNEWS RT_TRADER COMTEX PRIMEZONE INTERNET_WIRE CME-LTD EUREX NYMEX NYSE APCMB,,1300,QT_API,,
                          2010-07-13 13:06:29:421 (IQFeed) Dtn.Adapter.TryConnect1: S,KEYOK
                          2010-07-13 13:06:29:421 (IQFeed) Cbi.Connection.ProcessEventArgs.ConnectionStatusEventArgs Connected Connected NoError 
                          2010-07-13 13:06:29:514 (IQFeed) Cbi.Connection.ProcessEventArgs.AccountEventArgs: name='Sim101'
                          2010-07-13 13:06:29:514 (IQFeed) Cbi.AccountEventArgs.Process: Sim101
                          2010-07-13 13:06:29:530 (Db) Db.Globals.Recover1: 'Sim101'
                          [B]2010-07-13 13:06:30:076 ERROR: Strategy a19f96d38cc04e2c8fa6818158721914: unable to deserialize user data: There is an error in XML document (1, 17528).
                          2010-07-13 13:06:30:107 ERROR: Strategy e1e29e5b23d14d9db953318eb806e5c3: unable to deserialize user data: There is an error in XML document (1, 17535).
                          [/B]2010-07-13 13:06:30:154 (Db) Db.Globals.Recover2: 'Sim101'
                          2010-07-13 13:06:30:154 (IQFeed) Cbi.Account.RestorePositionExecutions1: account='Sim101'
                          2010-07-13 13:06:30:154 (IQFeed) Cbi.Account.RestorePositionExecutions9: account='Sim101'
                          2010-07-13 13:06:30:154 (IQFeed) Cbi.AccountUpdateEventArgs.Process: Account='Sim101' ItemType='BuyingPower' Currency='Unknown' Value=-23935.016170092
                          2010-07-13 13:06:30:154 (IQFeed) Cbi.AccountUpdateEventArgs.Process: Account='Sim101' ItemType='CashValue' Currency='Unknown' Value=-11967.508085046
                          2010-07-13 13:06:30:154 (IQFeed) Cbi.AccountUpdateEventArgs.Process: Account='Sim101' ItemType='ExcessEquity' Currency='Unknown' Value=-7767.50808504598
                          2010-07-13 13:06:30:154 (IQFeed) Cbi.AccountUpdateEventArgs.Process: Account='Sim101' ItemType='InitialMargin' Currency='Unknown' Value=6000
                          2010-07-13 13:06:30:154 (IQFeed) Cbi.AccountUpdateEventArgs.Process: Account='Sim101' ItemType='RealizedProfitLoss' Currency='Unknown' Value=0
                          2010-07-13 13:06:30:154 (IQFeed) Cbi.ConnectionStatusEventArgs.Process: Connected Connected
                          2010-07-13 13:06:30:216 (IQFeed) defaultTimeToClose=4/1/2010 12:00:00 AM flattenAll=False
                          I only have charts open when connecting to IQFeed. No strategies are running on any of the charts. How can I go about fixing these 2 deserialization errors without resorting to a restore from a backup?

                          JD

                          Comment


                            #14
                            Nevermind, I solved my 2 errors simply by resetting my Sim account via Tools -> Options -> Simulator -> Reset...

                            JD

                            Comment


                              #15
                              Glad you got it resolved. Please let us know if we can be of any further assistance. Thank you.

                              Should you experience this again in the future can you also send us your DB before resetting the Sim account? Thanks.
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by rayyyu12, Yesterday, 05:38 PM
                              1 response
                              17 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Started by thumper57, Yesterday, 04:30 PM
                              1 response
                              10 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Started by dcriador, Yesterday, 12:06 PM
                              1 response
                              17 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Started by dcriador, Yesterday, 12:04 PM
                              1 response
                              18 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Started by cutzpr, Yesterday, 08:54 AM
                              1 response
                              16 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Working...
                              X