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

reflecting type error

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

    reflecting type error

    I have an error when I am trying to save a workspace with my custom indicator.
    I get the following message :

    2017-05-24 09:37:12:113 ERROR: Could not save indicator 'Sherif:' There was an error reflecting type 'NinjaTrader.NinjaScript.Indicators.Sherif'.

    And when I reopen the workspace :

    2017-05-24 09:37:17:060 ERROR: Failed to restore Indicator 'Unknown'. 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.

    #2
    Hello blar58,

    Thanks for opening the thread.

    Without the complete source code, I am unable to reproduce on my end so my input may be limited.

    These issues have come up before and they tend to do with serializing objects that are to be used as parameters, or when public member objects that are declared that should be ignored for xml serialization.

    Some of these scenarios have been reviewed in the thread found here: http://ninjatrader.com/support/forum...ad.php?t=80414

    Using the guidance from that thread, I would advise to check any properties that you have that would need to be serialized and if you have any loose public member variables that are not ignored by the XML parser.

    Please let me know if I may be of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Jim

      I have looked at all my properties and I clearly don't see what cause this problem.

      All my Brush properties as well as public Series<double> coming from my Add Plot have the XmlIgnore apply to them.

      I have declared a public enum that is part of one of my property type. Do I have to Ignore XML on this. I tried with and without XmlIgnore with no success.

      Comment


        #4
        Hello blar58,

        Thanks for the reply.

        Could you write in to platformsupport [at] ninjatrader [dot] com with the source code of the indicator? I would like to examine the issue at hand to see if I can provide further input.

        Please include the thread URL and the text Attn Jim in the body of the message.

        I look forward to assisting you further.
        JimNinjaTrader Customer Service

        Comment


          #5
          I am sending the code to you right now Jim

          Comment


            #6
            Thank you Jim.

            Adding XmlIgnore to the two public SharpDX.Direct2D1.Brush solved the problem.

            But it is weird because I have other indicators that use public SharpDX.Direct2D1.Brush and they don't cause any problems even if they don't have the XmlIgnore apply to them ?

            That's the reason why I didn't think about that solution to solve my problem

            Comment


              #7
              Hello blar58,

              Reflecting type errors will almost always have to do with public variables being run through the XML parser unintentionally, or without being serialized. The solution is correct.

              Without the code for the other indicators, I could not provide further input. If you want to provide me an example of an indicator that uses public brushes and does not throw the same issues, I could take a look to see why.
              JimNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by warreng86, 11-10-2020, 02:04 PM
              7 responses
              1,361 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by Perr0Grande, Today, 08:16 PM
              0 responses
              5 views
              0 likes
              Last Post Perr0Grande  
              Started by elderan, Today, 08:03 PM
              0 responses
              9 views
              0 likes
              Last Post elderan
              by elderan
               
              Started by algospoke, Today, 06:40 PM
              0 responses
              10 views
              0 likes
              Last Post algospoke  
              Started by maybeimnotrader, Today, 05:46 PM
              0 responses
              14 views
              0 likes
              Last Post maybeimnotrader  
              Working...
              X