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 pechtri, 06-22-2023, 02:31 AM
      10 responses
      124 views
      0 likes
      Last Post Leeroy_Jenkins  
      Started by judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      59 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Yesterday, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Yesterday, 07:39 PM
      0 responses
      7 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Yesterday, 03:01 PM
      2 responses
      22 views
      0 likes
      Last Post helpwanted  
      Working...
      X