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

deserialization problem

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

    deserialization problem

    Hi all ,

    I have a serious problem. I am about to deliver an indicator but I keep getting this message :
    Indicator 'NinjaTrader.Indicator.MyIndicator' could not be deserialized : There is an error in XML document(1,2079).

    This is something I have added lately because I wasn't getting that message before.

    I have added a lot of properties but when the property was a Color or a Font I have used the following syntax to serialize the objects :

    Code:
    [Browsable(false)]
    public string FontSerialize
     {
                get { return NinjaTrader.Gui.Design.SerializableFont.ToString(helper.captionFont); }
                set { helper.captionFont = NinjaTrader.Gui.Design.SerializableFont.FromString(value); }
            }
    For color I used :

    Code:
    [Browsable(false)]
            public string CloseTickColorSerialize
            {
                get { return NinjaTrader.Gui.Design.SerializableColor.ToString(helper.closeTickColor); }
                set { helper.closeTickColor = NinjaTrader.Gui.Design.SerializableColor.FromString(value); }
            }
    What could be wrong

    Is there a way to look at the XML file to get a clue ?

    #2
    Hello,

    Thanks for the forum post.

    Can you please remove the font property temporarly as a quick check to find out if its the font or the color that is causing the error. I have a feeling that it is the font serialization causing the issue however. Please comment this out and then just set a static font at the start of the indicator.

    I look forward to assisting you further.

    Comment


      #3
      Brett

      Here is what seems the problem

      Code:
      [Description("")]
              [Category("Volume Properties")]
              [Gui.Design.DisplayName("Number Format")]
              
              public FormattingType VFormat
              {
                  get { return helper.VFormat; }
                  set {  helper.VFormat=value;}
              }
      I don't understand because FormattingType is an enum...

      Comment


        #4
        Hi blar58, that's right enums shouldn't need serialization - any change if you change category to GridCategory for NT7? Have you tried saving the indicator to a complete new workspace file, same issue then seen?

        Thanks,
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Hi
          I faced the same problem when I updated the Gomi package indicators. I was able to workaround the issue by deleting the template file for that indicator in the $NT/templates/Indicator directory. I do not like that change since I will have to redo the defaults for these indicators.

          ===
          Update: It seems an enum value had some changes which was forcing the failure since the template saved for the indicator was using a value no longer valid. What we need is a better error message saying that the problem lies with the template saved for the indicator (and removing/editing that file will fix the problem).

          Right now a user is stuck dead in the water unless he knows where to find the xml file causing the problem (indicator template).
          Last edited by aviat72; 09-10-2011, 03:56 AM. Reason: Solution to the problem

          Comment


            #6
            Hello,

            Thanks for letting us know.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by f.saeidi, Today, 10:19 AM
            0 responses
            2 views
            0 likes
            Last Post f.saeidi  
            Started by kujista, Today, 06:23 AM
            4 responses
            14 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by traderqz, Yesterday, 09:06 AM
            2 responses
            16 views
            0 likes
            Last Post traderqz  
            Started by traderqz, Today, 12:06 AM
            3 responses
            6 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by RideMe, 04-07-2024, 04:54 PM
            5 responses
            28 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X