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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      67 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      96 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      53 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      108 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      63 views
      0 likes
      Last Post PaulMohn  
      Working...
      X