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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      68 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      151 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      100 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      288 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X