• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Errors saving Workspace or as an Indicator Template

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

    Errors saving Workspace or as an Indicator Template

    This NT8 ColorTimeRegion indicator is a converted NT7 indicator. Everything functions correctly with the indicator and it compiles error free. Problem is, when I try to save the indicator settings to a template, I get an XML error, also, when trying to save the Workspace, I get an error as well. I have attached the indicator and screen shots of the errors. Any help would be appreciated.
    Attached Files

    #2
    Hello mlarocco,

    Thank you for the post.

    Is this one of the items listed in the user app share? If so, can you provide a link to the download page?

    It seems that the brush properties in the file are missing the [XmlIgnore()] attribute. You can see an example of a correct brush property and serialization property listed here: https://ninjatrader.com/support/help...definedbrushes

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      No, it's not from the app share. I used the NT8 conversion script from the Ninja forum, using LINQPad5. I thought I was all set when it compiled error free and it even looks correct on the chart. I will look at what are recommending... Thanks

      Comment


        #4
        Hello mlarocco,

        Thank you for the reply.

        Yes in this case the conversion script was not completely successful as it missed some attributes. You can modify the resulting script to include the [XmlIgnore()] on the Brush properties.

        The link I had provided shows one full brush property as an example, this is what the syntax should look like for all brush properties in the script:

        Code:
        [XmlIgnore]
        public Brush MyBrush { get; set; }
        
        [Browsable(false)]
        public string MyBrushSerialize
        {
          get { return Serialize.BrushToString(MyBrush); }
          set { MyBrush = Serialize.StringToBrush(value); }
        }
        I have bolded the Name for the brush, this is going to change for each brush property.

        Here is an example from the script you had provided:

        Code:
        [Display(Name = "Region Color", Description = "Color for 3rd region", GroupName = "3rd Time Region", Order = 5)]
        [XmlIgnore]
        public Brush Region3Color
        {
             get { return region3Color; }
             set { region3Color = value; }
        }
        
        [Browsable(false)]
        public string Region3ColorSerialize
        {
              get { return Serialize.BrushToString(region3Color); }
              set { region3Color = Serialize.StringToBrush(value); }
        }
        here i have bolded the added [XmlIgnore] attribute, this would need to be added to each of the brush properties. The property below it converts the brush to a string so it can be saved/loaded with the workspace. The error is caused because the workspace is trying to save a brush which is more complex than a string.




        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Adding the [XmlIgnore()] attribute fixed the problem.... Thanks again

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by chazyang, Today, 02:01 AM
          1 response
          3 views
          0 likes
          Last Post chazyang  
          Started by tonynt, Today, 01:20 AM
          0 responses
          13 views
          0 likes
          Last Post tonynt
          by tonynt
           
          Started by sdauteuil, Yesterday, 11:02 PM
          1 response
          3 views
          0 likes
          Last Post sdauteuil  
          Started by Jschmelz, Yesterday, 04:45 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Marco  
          Started by sisenberg, Yesterday, 08:06 PM
          1 response
          11 views
          0 likes
          Last Post sisenberg  
          Working...
          X