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

Unusual error message randomly appears

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

    Unusual error message randomly appears

    Could not save indicator ':' There was an error reflecting type 'NinjaTrader.NinjaScript.Indicators.MyIndicators.M yCustomHL2'.

    It will run for say 30n minutes and then I get this.
    Can NT explain what this is trying to tell me?

    #2
    Hello Mindset,

    Thank you for your post.

    Does your indicator have public objects?

    Are those all using the XmlIgnore attribute?

    Thanks in advance; I look forward to assisting you further.​
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thanks Kate.

      I have looked at the help pages on this and downloaded the sampleBrushInput file.
      I am slightly confused - if I declare a public property whenever I set a template only the default value would be saved?
      Should all public property declarations be XML ignore ()?

      Definition
      Determines if the following declared property participates in the XML serialization routines which are used to save NinjaScript objects to a workspace or template. The default behavior will attempt to serialize all public properties, however there may be some types of objects which cannot be serialized, or you may not wish for this property to be saved/restored. Should that be the case, you can optionally set the object to be ignored by defining the XmlIgnore attribute.

      But when I change the default color and save it as a template it saves the new color - which seems contrary to the help definition above?

      Comment


        #4
        mmm I am in a world of pain now.
        Eventually I [XmlIgnore] everything but I still get that it can't be reflected when I try to save the template.
        I've only used NT for 10 years but I have never come across this and as I am a self-taught coder I simply don't understand what
        the problem is.

        I should add the indicator behaves perfectly well.

        Comment


          #5
          Hello Mindset,

          Thank you for your replies.

          I'm happy to take a look to see where the issue may be if you can post the indicator as you currently have it. You can export the indicator from Tools > Export > NinjaScript Addon. Do not check the box to export as a compiled assembly or I will not be able to review your logic. Please attach the resulting .Zip file to your reply.

          Thanks in advance; I look forward to assisting further.
          Kate W.NinjaTrader Customer Service

          Comment


            #6
            Thanks for the offer Kate.
            Let me strip it down first and see if I can pinpoint the issue - If I fail I will send it to you!!
            The basic indicator has worked for years so I know it's just recent changes that have caused this - it's just extremely frustrating to be intermediate level at this coding business.

            Comment


              #7
              I think I resloved it with Kate's help. appears I had public variable declarations where I should have had private - specifically to do with Account.
              All appears to be back to normal.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Gianpiero, 12-01-2022, 05:06 AM
              5 responses
              76 views
              0 likes
              Last Post NinjaTrader_Adrian  
              Started by sjmuk1, 12-05-2022, 04:10 PM
              5 responses
              53 views
              0 likes
              Last Post NinjaTrader_Emily  
              Started by spottysallrite, Today, 04:21 PM
              0 responses
              4 views
              0 likes
              Last Post spottysallrite  
              Started by llanqui, Today, 03:56 PM
              1 response
              3 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by spottysallrite, Today, 02:50 PM
              3 responses
              13 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Working...
              X