• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Xml Error when opening NTWindow

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • toptrader
    started a topic Xml Error when opening NTWindow

    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:
    System.Xml.XmlException: The '+' character, hexadecimal value 0x2B, cannot be included in a name.
    This only happens every other time I try to open the NTWindow. Every other time it will open and so far it seems to work as expected. Is there an error in my code?
    Attached Files
    Last edited by toptrader; 11-21-2016, 01:54 PM.

  • NinjaTrader_ChelseaB
    replied
    Hello fx.practic,

    I've received tracking ID #SFT-3622 for your request for IWorkspacePersistance and NTWindow to be supported with AddOn subclasses.

    Please note it is up to the NinjaTrader Development to decide if or when any request will be implemented.

    We appreciate your feedback.

    Leave a comment:


  • fx.practic
    replied
    Thank You, Chelsea.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello fx.practic,

    Below is a link to an example of opening an addon window from an indicator and passing information back and forth.
    https://ninjatrader.com/support/foru...548#post774548

    I will submit your feature request to allow sub classes to implement IWorkspacePersistance.

    Leave a comment:


  • fx.practic
    replied
    Hello Chelsea,

    I would appreciate to get an example.

    I need just simple small notification window.
    So, I mean, I'd like to be able to declare NTWindow in my custom Indicator (it can be done with usual WPF window).
    Just to avoid excess definitions in global namespaces.

    Also, I want to submit a feature request to allow classes that implement IWorkspacePersistance to be sub classes.

    Thank You

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    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)

    Leave a comment:


  • fx.practic
    replied
    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.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    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.

    Leave a comment:


  • fx.practic
    replied
    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?

    Leave a comment:


  • NinjaTrader_JessicaP
    replied
    I have an update regarding NTEIGHT-10802. We have encountered a limitation in the underlying C# technology which we will be clearly documenting :
    1. any class which derives from NTWindow or implements IWorkspacePersistance cannot be a nested class of another class
    2. 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.

    Leave a comment:


  • NinjaTrader_JessicaP
    replied
    Thank you for your report, and for the updated code.


    This behavior was confirmed on our end. We will be investigating this further. Please keep an eye on the NinjaTrader 8 Release Notes page for updates and bugfixes.


    http://ninjatrader.com/support/helpG...ease_notes.htm


    Tracking ID: NTEIGHT-10802

    Leave a comment:


  • toptrader
    replied
    I followed your instructions, but I did not receive any dialogs about needing to recompile any dlls. I am still getting the same error after the uninstall and reinstall. Are you seeing the error on your end if you try to run the add on?

    Leave a comment:


  • NinjaTrader_JessicaP
    replied
    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

    Leave a comment:


  • toptrader
    replied
    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

    Leave a comment:


  • NinjaTrader_JessicaP
    replied
    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?
    Attached Files

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by manugarc, Today, 01:15 PM
0 responses
6 views
0 likes
Last Post manugarc  
Started by JMont1, Today, 11:42 AM
0 responses
4 views
0 likes
Last Post JMont1
by JMont1
 
Started by Steve L, Yesterday, 10:04 PM
0 responses
4 views
0 likes
Last Post Steve L
by Steve L
 
Started by marianfed, Yesterday, 09:47 PM
0 responses
5 views
0 likes
Last Post marianfed  
Started by hir04068, Yesterday, 09:29 PM
0 responses
8 views
0 likes
Last Post hir04068  
Working...
X