System.Xml.XmlException: The '+' character, hexadecimal value 0x2B, cannot be included in a name.
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
Xml Error when opening NTWindow
Collapse
X
-
Xml Error when opening NTWindow
I'm creating an addon to run in the background of NT8. I have attached the code for the Add On. When I click the MenuItem to display my custom NTWindow, I am receiving the following error:
Code:Last edited by toptrader; 11-21-2016, 01:54 PM.Tags: None
-
Hello toptrader, and thank you for your question.
I noticed your strategy contains characters outside the ASCII range between lines 177 and 181, and between lines 231 and 241, which are not part of your strategy logic. I am returning a copy of your strategy with these characters removed. This should resolve your query.
Please let us know if there are any other ways we can help.Attached FilesJessica P.NinjaTrader Customer Service
-
The differences are likely being caused by your code editor, and this may also be why characters outside the 0x00 - 0x7F range are invisible to you. I would like to recommend reviewing your code with an editor such as the freely and publicly available Notepad++, available here,
Once you have an editor which will reveal unprintable characters, please review your code around the lines I mentioned previously.Jessica P.NinjaTrader Customer Service
Comment
-
The editor I typically use, gvim when I am on windows, reveals the attached image. The left image is your original code, the right image is the modified code that I returned to you. For your benefit, I am also attaching hex dumps of both files to this reply. There are interesting characters around byte 0x1800.
Please ensure that you are loading the file you originally attached to your first reply into Notepad++ should you test in Notepad++, and not any files you have modified or copy / pasted into. It is important to do so, because it may be the case that your compiler or editor is adding garbage characters.
Have you had the same results when you use the code I sent you directly, rather than copying and pasting in?Jessica P.NinjaTrader Customer Service
Comment
-
OK. I have completely removed the lines of code where you are seeing extra characters, but I am still seeing the issue. I have attached the latest code I am using.Attached Files
Comment
-
Thank you for this update, toptrader. It looks like we have successfully removed the unprintable characters from your code. Since you are still seeing these messages, this means that your compiler is probably adding these characters. We can try to repair your compiler with a complete reinstall.
Please follow these steps to completely uninstall and reinstall NinjaTrader 8 on your system.
- Download a fresh copy of NinjaTrader 8 from ninjatrader.com
- Close NinjaTrader 8
- Rename your (My) Documents\NinjaTrader 8\db\NinjaTrader.sdf file so it becomes (My) Documents\NinjaTrader 8\db\NinjaTrader.20161122.sdf
- Rename your (My) Documents\NinjaTrader 8 folder so it becomes (My) Documents\NinjaTrader 8 - 20161122
- Use the installer you downloaded to uninstall, and then reinstall, NinjaTrader 8
- Copy these files and folders from your NinjaTrader 8 - 20161122 folder to your NinjaTrader 8 folder, under (My) Documents. If asked to replace files, always select "yes"
- Config.xml
- UI.xml
- workspaces
- templates
- all .dll files in bin\Custom except these :
- NinjaTrader.Custom.dll
- NinjaTrader.Vendor.dll
- all .cs files in bin\Custom except these :
- NinjaTrader.Custom.cs
- NinjaTrader.Vendor.cs
- AssemblyInfo.cs
- any subfolder of bin\Custom that has a .cs file that does not start with an @ sign
- Start NinjaTrader 8. You will receive some dialogs about Ninja being unable to start because it needed to recompile some dlls. OK out of these dialogs
- Start NinjaTrader 8 once more
Jessica P.NinjaTrader Customer Service
Comment
-
I have an update regarding NTEIGHT-10802. We have encountered a limitation in the underlying C# technology which we will be clearly documenting :
- any class which derives from NTWindow or implements IWorkspacePersistance cannot be a nested class of another class
- any class which derives from NTWindow or implements IWorkspacePersistance must have a default constructor
By default constructor, we mean a constructor which takes no arguments. In your code you will see a nested class near line 329. You will need to refactor your code so that this class is in another file, or so its code is part of your outer class.
Please let us know if there are any other ways we can help.Jessica P.NinjaTrader Customer Service
Comment
-
Hello
I have absolutely same problem in 8.0.16.2 64-bit today.
Does bus still not fixed, of am I just not lucky?
Comment
-
Hello fx.practic,
NTEIGHT-10802 is not marked as corrected and was not listed in the release notes as corrected. This is marked as expected.
To confirm, your addon class is a subclass is this correct?
As this was marked as expected, I am happy to submit a feature request to allow classes that implement IWorkspacePersistance to be sub classes if you would like.Chelsea B.NinjaTrader Customer Service
Comment
-
Hello Chelsea, thank You for the answer.
I don't want to implement IWorkspacePersistance, only derive from NTWindow.
I move my class outside Indicator class, inside Indicators namespace and it starts work.
I was able to make my class private and to use parameters in window constructor.
And Yes, please, submit feature to let custom classes, derived from NTWindow and implemented IWorkspacePersistance, to be nested (at least, inside Indicator and Strategy class).
I believe this would be a good approach meaning encapsulation ideology.Last edited by fx.practic; 11-06-2018, 03:06 AM.
Comment
-
Hello fx.practic,
I'm not certain that I am understanding. You are trying to make an Addon that inherits from NTWindow and also have this be in the NinjaScript.Indicator namespace?
This is not supported and not advised.
Are you trying to open an addon window from a indicator? (I have an example that demonstrates this)Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by brunoviveiros, 02-17-2020, 05:31 AM
|
4 responses
63 views
0 likes
|
Last Post Today, 06:25 AM | ||
Started by volIQ, 03-27-2024, 04:28 PM
|
3 responses
21 views
0 likes
|
Last Post
by RJay
Today, 05:41 AM
|
||
Started by Nickgiaco, 02-26-2024, 10:23 AM
|
2 responses
72 views
0 likes
|
Last Post Today, 05:12 AM | ||
Started by Johndc, Today, 04:39 AM
|
0 responses
8 views
0 likes
|
Last Post
by Johndc
Today, 04:39 AM
|
||
Started by johntraderuser2, Today, 02:34 AM
|
0 responses
11 views
0 likes
|
Last Post Today, 02:34 AM |
Comment