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 argusthome, Yesterday, 10:06 AM
      0 responses
      14 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      11 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      9 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      4 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      31 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X