Announcement

Collapse
No announcement yet.

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.

    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.

        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.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              579 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              334 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              554 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              551 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X