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!
See more
See less

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.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by mmckinnm, Today, 01:34 PM
    0 responses
    2 views
    0 likes
    Last Post mmckinnm  
    Started by f.saeidi, Today, 01:32 PM
    0 responses
    2 views
    0 likes
    Last Post f.saeidi  
    Started by traderqz, Today, 12:06 AM
    9 responses
    16 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by kevinenergy, 02-17-2023, 12:42 PM
    117 responses
    2,766 views
    1 like
    Last Post jculp
    by jculp
     
    Started by Mongo, Today, 11:05 AM
    5 responses
    15 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X