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 restore indicator

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

    Failed to restore indicator

    07.02.2009 11:11:44|3|4|Failed to restore indicator 'NinjaTrader.Indicator.MarketProfile'. Most likely (a) the implementation changed or (b) one or more properties have been renamed or removed or (c) the custom assembly which implements this indicator no longer is there.

    Hi,

    After loading NT I get the error message above. It has to do with applying an self-written indicator to a chart in the default workspace. This indicator doesn't load after re-invocation of NT. I did the following to get rid of that message:

    - Compiled the indicator after last modification.
    - Saved all workspaces

    But that doesn't solve the problem. The message disappears only when I either delete the indicator from the chart or remove the default workspace xml setup from the workspaces-directory.

    Any idea how proceed?

    Regards
    Ralph

    #2
    Hello,

    It sounds like there is something wrong with the indicator. Post it and I will test it for you.
    DenNinjaTrader Customer Service

    Comment


      #3
      Testcase

      Hi Ben,

      attached you could find a testcase. It is just a framework of the indicator but it "works" on my side. Please load it to a chart, save the workspace, quit and restart NT. Then I can see the concerning message in the log tab and the indicator is not reloaded to the chart.

      Regards
      Ralph
      Attached Files

      Comment


        #4
        Hello,

        The same thing happened to me. Something is wrong with the indicator. I suggest commenting things out until it works, to find the issue.
        DenNinjaTrader Customer Service

        Comment


          #5
          Unfortunately this is beyond the level we can provide support for.

          Hint: NT indicators are XML serialized. I noticed several public properties having non xml-serializable types like Color, ProfileBaseTest, TimeSpan etc. You need to clear those out e.g. by using concepts like PaintColorSerializable here: http://www.ninjatrader-support2.com/...ead.php?t=4977

          Comment


            #6
            I understand the point, thanks a lot Dierk.

            Regards
            Ralph

            Comment


              #7
              The error message mentioned in my first post was caused by a public property which I defined for a class instance. This instance was not prepared for serialization because it was not intended to be serialized. Applying the attribute [XmlIgnore()] to this property solved the issue.

              Regards
              Ralph

              Comment


                #8
                Thanks for sharing this Ralph, great you got it resolved.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  re: Serialization Error

                  Yeah, I'm getting this error as well. I checked out the SampleColorInput.zip. Does this mean that ALL my variables need to have the XmlIgnore, ...Serialize, , etc. in the Properties region?

                  Comment


                    #10
                    Not for all, because C# provides type converters for the basic types and the compiler applies them automatically. More complex types (Dierk gives some examples in his reply) you need to serialize by your own.

                    Regard
                    Ralph

                    Comment


                      #11
                      hmm, well let's see, I have a couple of homegrown classes. I'm utilizing a Dictionary Collection, a List<>. Most of what I have I don't want to be editable in properties window, ie: [Category("Parameters")]. Is there any documentation on what are my other choices? And I guess I have to keep "serializing" until I don't get the error any more.

                      Comment


                        #12
                        Originally posted by funk101 View Post
                        ...And I guess I have to keep "serializing" until I don't get the error any more.
                        No, fortunately not. Serialisation is desired only, if you would like to store the property's context somewhere else (xml file) in text format. You need to deal with 2 attributes only, they are described on the MS C#-webpage:

                        [XmlIgnore()] - don't serialize during runtime
                        [Browsable(false)] - don't display in the property grid

                        Regards
                        Ralph

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by trilliantrader, 04-10-2024, 09:33 PM
                        6 responses
                        25 views
                        0 likes
                        Last Post trilliantrader  
                        Started by traderqz, Today, 12:06 AM
                        5 responses
                        10 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Started by Mongo, Today, 11:05 AM
                        2 responses
                        9 views
                        0 likes
                        Last Post Mongo
                        by Mongo
                         
                        Started by guillembm, Today, 11:25 AM
                        0 responses
                        4 views
                        0 likes
                        Last Post guillembm  
                        Started by Tim-c, Today, 10:58 AM
                        1 response
                        3 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Working...
                        X