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

Getting an "unable to deserialize user data" when restarting NT8

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

    Getting an "unable to deserialize user data" when restarting NT8

    I have a strategy that generate the following error after saving a workspace with strategy.

    Strategy '205477926': unable to deserialize user data: There is an error in XML document (2, 2).

    I have removed all workspaces, and I still get the error. At the end of the NT8 splash screen, I get an "unhandled exception: object reference not set to an instance of an object", then NT8 terminates without loading UI.

    On my strategy, I have removed all properties (user input) , so there should be no XML to load or create for those.

    What does the (2, 2) mean ? and what should I look for in my strategy to make changes so that it functions properly?

    The strategy functions properly, but it seems that when getting called upon in the workspace is the issue.


    Thanks!

    #2
    Hello lakersfan,

    The error really does not provide any relevant detail other than there is some problem with deserializing. There are a few items you can try here to see what the cause may be.

    First I would suggest checking if temporarily removing the strategy helps to let you use the platform. Try moving the strategy from the folder: Documents\NinjaTrader 8\bin\Custom\Strategies to your desktop.

    You may also want to try removing any templates you have for the strategy: Documents\NinjaTrader 8\templates\Strategy

    One additional test would be to rename your database. Open the folder Documents\NinjaTrader 8\db and rename the NinjaTrader.sdf file to NinjaTrader.Old.sdf


    Please let me know if these items are not able to help resolve the error.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello lakersfan,

      The error really does not provide any relevant detail other than there is some problem with deserializing. There are a few items you can try here to see what the cause may be.

      First I would suggest checking if temporarily removing the strategy helps to let you use the platform. Try moving the strategy from the folder: Documents\NinjaTrader 8\bin\Custom\Strategies to your desktop.

      You may also want to try removing any templates you have for the strategy: Documents\NinjaTrader 8\templates\Strategy

      One additional test would be to rename your database. Open the folder Documents\NinjaTrader 8\db and rename the NinjaTrader.sdf file to NinjaTrader.Old.sdf


      Please let me know if these items are not able to help resolve the error.
      Yes temporarily removing and re-adding strategy works fine on first instance. I am looking for a solution to my code so that this does not happen again. My issue is not restarting NT8. The error I mentioned is the only error I get. Where else should I look besides log and trace?

      Comment


        #4
        Hello lakersfan,

        If you can remove it and then access the platform that will help. I understand the problem is more than that but you can now debug the script if the platform doesn't close before reaching the UI.

        I would suggest to try to replicate the problem in another script by making a copy of your code but giving the strategy a new name (leave the other script out of your custom folder). That will address if this relates to the database or templates.

        If the problem still happens in the new file that may instead relate to the code, at that point you can try to reduce the code or attach a sample that shows the problem and we can try to review why that's happening.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello lakersfan,

          If you can remove it and then access the platform that will help. I understand the problem is more than that but you can now debug the script if the platform doesn't close before reaching the UI.

          I would suggest to try to replicate the problem in another script by making a copy of your code but giving the strategy a new name (leave the other script out of your custom folder). That will address if this relates to the database or templates.

          If the problem still happens in the new file that may instead relate to the code, at that point you can try to reduce the code or attach a sample that shows the problem and we can try to review why that's happening.

          I look forward to being of further assistance.
          Yes, I'm currently debugging, the problem is happening on a fresh install on NT8 (no other strategies/ indicators) are installed. I've re-exported the strategy with several different names. Before importing, I remove ALL ninjascript assemblies so that there are no conflicts.

          If you are unable to help further, what does this mean, exactly (unable to deserialize user data: There is an error in XML document (2, 2)) That way I can debug my code with this problem in mind.

          Note: one thing I forgot to mention is that this problem does not occur on my NT8 debug machine. The error is on another machine. Regardless, I am debugging the code with this in mind.
          Last edited by lakersfan; 07-01-2020, 03:37 PM.

          Comment


            #6
            Hello lakersfan,

            Yes, I'm currently debugging, the problem is happening on a fresh install on NT8 (no other strategies/ indicators) are installed. I've re-exported the strategy with several different names. Before importing, I remove ALL ninjascript assemblies so that there are no conflicts.
            Ok, if this is happening with only your code in a fresh install you have reached this part of my last comment:

            If the problem still happens in the new file that may instead relate to the code, at that point you can try to reduce the code or attach a sample that shows the problem and we can try to review why that's happening.
            So now we would need to know what code is being used to better understand the problem. If you don't want to post the whole strategy that is fine and we generally won't ask for all of your code. What would be good is to now comment out as much code as you can to find where it begins to work again. After that uncomment the code which you last commetned to bring back the problem and we can address that syntax.

            If you are unable to help further, what does this mean, exactly (unable to deserialize user data: There is an error in XML document (2, 2)) That way I can debug my code with this problem in mind.
            We can continue to troubleshoot this until we isolate the issue. I had only provided some starting steps to better isolate the issue in the last post. Now that you have isolated this down to your code we can continue tracking the problem to a specific part of the script. I can really only instruct at this point as I don't know what code was used, once I have more information on the code that will help with finding new areas to explore.


            Note: one thing I forgot to mention is that this problem does not occur on my NT8 debug machine. The error is on another machine. Regardless, I am debugging the code with this in mind.
            That could be a hint at the problem however if you are running into the problem using source code on the other machine that may also happen on other machines as well. That would be a good situation to comment out as much code as possible to leave just the problematic code. Once you have that you can delete the commented code if you want to hide your logic and we can review what you have left. If I don't see the problem and it specifically relates to that one PC then we can go from there knowing that.


            I look forward to being of further assistance.



            JesseNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Jesse View Post
              Hello lakersfan,


              Ok, if this is happening with only your code in a fresh install you have reached this part of my last comment:



              So now we would need to know what code is being used to better understand the problem. If you don't want to post the whole strategy that is fine and we generally won't ask for all of your code. What would be good is to now comment out as much code as you can to find where it begins to work again. After that uncomment the code which you last commetned to bring back the problem and we can address that syntax.



              We can continue to troubleshoot this until we isolate the issue. I had only provided some starting steps to better isolate the issue in the last post. Now that you have isolated this down to your code we can continue tracking the problem to a specific part of the script. I can really only instruct at this point as I don't know what code was used, once I have more information on the code that will help with finding new areas to explore.




              That could be a hint at the problem however if you are running into the problem using source code on the other machine that may also happen on other machines as well. That would be a good situation to comment out as much code as possible to leave just the problematic code. Once you have that you can delete the commented code if you want to hide your logic and we can review what you have left. If I don't see the problem and it specifically relates to that one PC then we can go from there knowing that.


              I look forward to being of further assistance.


              Thanks, I scrapped the old strategy. Starting anew, problems are gone.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by GussJ, 03-04-2020, 03:11 PM
              16 responses
              3,279 views
              0 likes
              Last Post Leafcutter  
              Started by WHICKED, Today, 12:45 PM
              2 responses
              19 views
              0 likes
              Last Post WHICKED
              by WHICKED
               
              Started by Tim-c, Today, 02:10 PM
              1 response
              9 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Taddypole, Today, 02:47 PM
              0 responses
              5 views
              0 likes
              Last Post Taddypole  
              Started by chbruno, 04-24-2024, 04:10 PM
              4 responses
              52 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Working...
              X