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 cls71, Today, 04:45 AM
              0 responses
              1 view
              0 likes
              Last Post cls71
              by cls71
               
              Started by mjairg, 07-20-2023, 11:57 PM
              3 responses
              213 views
              1 like
              Last Post PaulMohn  
              Started by TheWhiteDragon, 01-21-2019, 12:44 PM
              4 responses
              544 views
              0 likes
              Last Post PaulMohn  
              Started by GLFX005, Today, 03:23 AM
              0 responses
              3 views
              0 likes
              Last Post GLFX005
              by GLFX005
               
              Started by XXtrader, Yesterday, 11:30 PM
              2 responses
              12 views
              0 likes
              Last Post XXtrader  
              Working...
              X