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!
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
NinjaTrader
Errors saving Workspace or as an Indicator Template
Collapse
X
-
Errors saving Workspace or as an Indicator Template
This NT8 ColorTimeRegion indicator is a converted NT7 indicator. Everything functions correctly with the indicator and it compiles error free. Problem is, when I try to save the indicator settings to a template, I get an XML error, also, when trying to save the Workspace, I get an error as well. I have attached the indicator and screen shots of the errors. Any help would be appreciated.Tags: None
-
Hello mlarocco,
Thank you for the post.
Is this one of the items listed in the user app share? If so, can you provide a link to the download page?
It seems that the brush properties in the file are missing the [XmlIgnore()] attribute. You can see an example of a correct brush property and serialization property listed here: https://ninjatrader.com/support/help...definedbrushes
I look forward to being of further assistance.JesseNinjaTrader Customer Service
-
Hello mlarocco,
Thank you for the reply.
Yes in this case the conversion script was not completely successful as it missed some attributes. You can modify the resulting script to include the [XmlIgnore()] on the Brush properties.
The link I had provided shows one full brush property as an example, this is what the syntax should look like for all brush properties in the script:
Code:[XmlIgnore] public Brush [B]MyBrush [/B]{ get; set; } [Browsable(false)] public string [B]MyBrush[/B]Serialize { get { return Serialize.BrushToString([B]MyBrush[/B]); } set { [B]MyBrush [/B]= Serialize.StringToBrush(value); } }
Here is an example from the script you had provided:
Code:[Display(Name = "Region Color", Description = "Color for 3rd region", GroupName = "3rd Time Region", Order = 5)] [B][XmlIgnore][/B] public Brush Region3Color { get { return region3Color; } set { region3Color = value; } } [Browsable(false)] public string Region3ColorSerialize { get { return Serialize.BrushToString(region3Color); } set { region3Color = Serialize.StringToBrush(value); } }
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by WHICKED, Today, 12:56 PM
|
1 response
8 views
0 likes
|
Last Post Today, 01:17 PM | ||
Started by cre8able, Today, 01:16 PM
|
0 responses
2 views
0 likes
|
Last Post
by cre8able
Today, 01:16 PM
|
||
Started by chbruno, 04-24-2024, 04:10 PM
|
2 responses
47 views
0 likes
|
Last Post
by chbruno
Today, 01:15 PM
|
||
Started by WHICKED, Today, 12:45 PM
|
1 response
11 views
0 likes
|
Last Post Today, 01:08 PM | ||
Started by samish18, Today, 01:01 PM
|
0 responses
6 views
0 likes
|
Last Post
by samish18
Today, 01:01 PM
|
Comment