NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 12-04-2008, 05:05 AM   #1
shawnj
Senior Member
 
Join Date: Jan 2005
Location: , ,
Posts: 218
Thanks: 0
Thanked 0 times in 0 posts
Default More Serialization Bugs - SolidBrush

Please add the ability to serialize a SolidBrush.

Or better yet, can we flag individual member variables to not be serialized. In the code below, I don't need FTestBrush to be persisted (written to the disk). But I do need to be able to save the indicator in a workspace. The attribute [NonSerialized] holds the promise of dealing with these serialization errors but best I can tell, adding the attibute makes no difference conserning the serialization error.

The following indicator generates a serialization error when you try to save it in a workspace:

Code:
namespace NinjaTrader.Indicator
{
 public class aaaTestSerialize : Indicator
 {
  [NonSerialized]   //This does not seem to help.		
  public SolidBrush FTestBrush; //Fails Serialization
		
  protected override void Initialize()
  {} 
  protected override void OnBarUpdate()
  {} 
 }
}
Last edited by shawnj; 12-04-2008 at 05:24 AM.
shawnj is offline  
Reply With Quote
Old 12-04-2008, 07:33 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

shawnj,

Thank you for the suggestion. If you do not mind could you please post future requests to the Suggestions and Feedback section in the forums? Thank you. I have forwarded this to development.
NinjaTrader_Josh is offline  
Reply With Quote
Old 12-04-2008, 07:48 AM   #3
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

To put this into right perspective: This is not a bug, but a limitation of the standard .NET XML serialization. Please consult MS docs for details. In the MS docs you e.g. would find how to properly use the [XmlIgnore()] attribute.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 12-04-2008, 09:06 AM   #4
cls71
Senior Member
 
Join Date: Jan 2008
Location: Madrid, Spain
Posts: 229
Thanks: 2
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Dierk View Post
To put this into right perspective: This is not a bug, but a limitation of the standard .NET XML serialization. Please consult MS docs for details. In the MS docs you e.g. would find how to properly use the [XmlIgnore()] attribute.
Thanks very much Dierk, with this attribute Font variables can be saved in a template, now.
cls71 is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Serialization Error shawnj Indicator Development 29 11-14-2011 06:11 AM
Serialization Bug shawnj Indicator Development 2 12-03-2008 12:28 AM
Serialization error ct Strategy Development 1 09-12-2008 02:32 PM
Bugs Mike_32 Miscellaneous Support 4 07-24-2008 07:53 AM
Bugs? MAX Automated Trading 5 01-02-2007 06:13 AM


All times are GMT -6. The time now is 04:59 PM.