Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

I did stack overflow in a parameter, now NinjaTrader crashes upon restarting

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

    I did stack overflow in a parameter, now NinjaTrader crashes upon restarting

    I did something like this:

    public int[] x
    {
    get { return x; }
    set { x= value; }
    }

    And now NinjaTrader won't start. I understand I need to uppercase the property name. Tried deleting the C# file (but I should probably delete whatever it compiles to; what does it compile to?)

    While at it, you can tell I am trying to use an array as a parameter. Is it possible at all? Or any collection for that matter.

    #2
    Hello,

    If you have removed the .cs file, but still have the problem this is likely because the Custom assembly has not been recompiled without the file.

    Please try the following after removing the .cs file:

    Open the folder: Documents\NinjaTrader 7\bin\Custom
    Look for NinjaTrader.Custom.dll
    Delete only the one file named NinjaTrader.Custom.dll
    Now restart the platform.

    If the script no longer exists and the NinjaTrader.Custom.dll is removed, NinjaTrader will be forced to recompile on startup. If there are no errors this should allow for the platform to start.

    For your second question, yes you can have a collection as a public property. Please note that with public properties and more advanced objects like collections, you will generally run into serialization errors or problems displaying the property in the properties grid.

    to avoid this, if you are getting errors you would need to place the attribute tag [XmlIgnore] on the property, also collections generally do not work in the Properties grid, to hide this from the properties you would also need to add [Browsable(false)]

    Code:
    private int[] x;
    
    [XmlIgnore]
    [Browsable(false)]
    public int[] X
    {
    	get { return x; }
    	set { x= value; }
    }
    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    142 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    81 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    125 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    120 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    98 views
    0 likes
    Last Post CarlTrading  
    Working...
    X