Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Brandon H.NinjaTrader Customer Service

    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 reynoldsn, 05-10-2024, 07:04 PM
      1 response
      14 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by franciscog21, 05-10-2024, 05:27 PM
      1 response
      30 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by llanqui, Today, 11:10 AM
      0 responses
      8 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by llanqui, Today, 10:29 AM
      0 responses
      9 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by llanqui, Today, 08:32 AM
      1 response
      16 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Working...
      X