Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

xml error while saving workspace using meda brush

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

    xml error while saving workspace using meda brush

    My indicator works but I get an error saving my workspace this is my parameter. vI went through all my code and this section gives me the error

    [XmlIgnore]
    private System.Windows.Media.Brush pBullBrush =System.Windows.Media.Brushes.Green;
    [Display(Name="Up Trend", Description="", Order=2, GroupName="Trend Bar")]
    public System.Windows.Media.Brush BullBrush {
    get { return pBullBrush; }
    set { pBullBrush = value; } }

    [Browsable(false)]

    public string pBullBrushSerialize
    {
    get { return Serialize.BrushToString(pBullBrush); }
    set { pBullBrush = Serialize.StringToBrush(value); }

    }


    I Can load my indicator to the chart and have no issues ONLY saving workspace Gives me the error There was an error generateing the XML document.

    #2
    Hello ballboy11,

    Thank you for your post.

    Applying XmlIgnore on a private property will not do anything. Brushes are not a serializable type meaning they cannot be converted to Xml directly. You could use XmlIgnore on the public Brush property and have it create a brush from a serializable type such as a string.

    Here is a Help Guide link with more information about how this can be accomplished - https://ninjatrader.com/support/help...lor_inputs.htm

    Please let us know if we may further assist.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Well I Figured it out. I created a template for others to use for Regions boxes and fills.
      Attached Files

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      648 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      369 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      108 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      572 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      574 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X