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

Strategy 'Blabla' could not be deserialized: There is an error in XML doc (1, 4762)

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

    Strategy 'Blabla' could not be deserialized: There is an error in XML doc (1, 4762)

    I have added a parameter to my strategy and NinjaTrader doesn't like it. It gives me the error "Strategy 'Blabla' could not be deserialized: There is an error in XML doc (1, 4762)"

    The parameter is based on an enum like this:

    Code:
            public enum LogOutput 
            {
                FILE,
                SCREEN,
                NONE
            }
    
            [Description("File/screen/none")]
            [GridCategory("Parameters")]
            public LogOutput Logging
            {
                get { return logging; }
                set { logging = value; }
            }
    If I take out the parameter declaration, everything compiles fine.

    I have another enum-based parameter which doesn't present any problems (below). What is wrong with this new one?

    Code:
            public enum TradingEnabled
            {
                L,
                S,
                LS
            }
    
            [Description("long/short/both")]
            [GridCategory("Parameters")]
            public TradingEnabled Direction
            {
                get { return direction; }
                set { direction = value; }
            }
    Thanks
    Last edited by adamus; 01-14-2011, 11:32 AM.

    #2
    Hi adamus,

    It works OK here. Can save in workspaces / templates with no issue. How is your private LogOuput logging declared?
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan,

      it's declared like this:

      Code:
              private LogOutput logging = LogOutput.SCREEN;
              private TradingEnabled direction = TradingEnabled.LS;
      Sorry but what do you mean by "can save in workspace/templates"? I have this in a strategy in the normal place where all my strategies are and I just hit 'compile' every time, normally.
      Last edited by adamus; 01-14-2011, 11:34 AM.

      Comment


        #4
        Serialization issues happen when saving to XML files via workspace or templates.

        There is no issue with the code - running it fine here. I suggest recreating a script with only this to isolate from other parts you have.

        If you are still running into issues, please attach this file with everything else stripped out.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          OK I recreated the script with a new name and the problem resolved itself.

          Thanks for the help.

          Comment


            #6
            Hi,
            Today I got the same error. I even received an email alert from NT:
            NinjaTrader Log Alert:Strategy 'NinjaTrader.Strategy.ZZDC' could not be deserialized: There is an error in XML document (1, 12835).

            The solution for me was also to rename the strategy and recompile.
            Still it is a bug!

            Baruch

            Comment


              #7
              Thank you for the report, Baruch. Can you please submit the workspace xml and strategy file to [email protected] Attn: RyanM. We will try to reproduce here.
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                Hi Rayn,
                I sent it.

                Baruch

                Comment


                  #9
                  Has there been any work on this issue?

                  I have just run into it again. This time it is particularly annoying because the work-around (to rename the strategy) is not an option that's available. It must be what it is - a word that means something.

                  Is there any other work-around?

                  Comment


                    #10
                    adamus,

                    Is there any improvement if you move the enum declaration outside the ninjatrader namespace? Place it according to this sample:
                    Ryan M.NinjaTrader Customer Service

                    Comment


                      #11
                      Ryan

                      I played around some more trying to work out exactly what it was and it turns out that it was the variable and property called "logging" and "Logging". I changed that to another word and it compiled. It must be something to do with keywords.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by terofs, Yesterday, 04:18 PM
                      1 response
                      21 views
                      0 likes
                      Last Post terofs
                      by terofs
                       
                      Started by CommonWhale, Today, 09:55 AM
                      1 response
                      3 views
                      0 likes
                      Last Post NinjaTrader_Erick  
                      Started by Gerik, Today, 09:40 AM
                      2 responses
                      7 views
                      0 likes
                      Last Post Gerik
                      by Gerik
                       
                      Started by RookieTrader, Today, 09:37 AM
                      2 responses
                      13 views
                      0 likes
                      Last Post RookieTrader  
                      Started by alifarahani, Today, 09:40 AM
                      1 response
                      7 views
                      0 likes
                      Last Post NinjaTrader_Jesse  
                      Working...
                      X