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

How to setup array member as input

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

    How to setup array member as input

    I know it's maybe generic C# question, but also falls in NT

    lets say, the defualt way to set input is:

    [GridCategory("Parameters")]
    [Gui.Design.DisplayName ("MA_2_Length")]
    public int MA_2_Length
    {
    ....

    but I am interested, is there any way to set like :

    public int[] Ma_Lengths = new int[] {14,54}

    [GridCategory("Parameters")]
    [Gui.Design.DisplayName ("MA_2_Length")]
    Ma_Lengths[2] {
    get; set;
    }


    so, directly the array member was set as an input.. I tried much, but couldnt solve this.
    Probably you (or Jesse) could help?

    thanks in advance.

    #2
    Hello TazoTodua,

    Thanks for your inquiry.

    It's possible to use an int array as an input parameter. If you are trying to set one member of the array, you could make an input of type int and then use the getter and setter to assign the value to the member of the array.

    I've attached an example demonstrating.

    Please let us know if this does not resolve your inquiry.
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      thanks.
      I was trying just to avoid setter/getter and directly set them. however ok, thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by alifarahani, Today, 09:40 AM
      6 responses
      31 views
      0 likes
      Last Post alifarahani  
      Started by Waxavi, Today, 02:10 AM
      1 response
      17 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by Kaledus, Today, 01:29 PM
      5 responses
      13 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by Waxavi, Today, 02:00 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by gentlebenthebear, Today, 01:30 AM
      3 responses
      17 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X