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 samish18, 04-17-2024, 08:57 AM
    16 responses
    55 views
    0 likes
    Last Post samish18  
    Started by arvidvanstaey, Today, 02:19 PM
    3 responses
    9 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by jordanq2, Today, 03:10 PM
    2 responses
    8 views
    0 likes
    Last Post jordanq2  
    Started by traderqz, Today, 12:06 AM
    10 responses
    18 views
    0 likes
    Last Post traderqz  
    Started by algospoke, 04-17-2024, 06:40 PM
    5 responses
    47 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X