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 DanielSanMartin, Yesterday, 02:37 PM
      2 responses
      12 views
      0 likes
      Last Post DanielSanMartin  
      Started by DJ888, 04-16-2024, 06:09 PM
      4 responses
      12 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by terofs, Today, 04:18 PM
      0 responses
      11 views
      0 likes
      Last Post terofs
      by terofs
       
      Started by nandhumca, Today, 03:41 PM
      0 responses
      7 views
      0 likes
      Last Post nandhumca  
      Started by The_Sec, Today, 03:37 PM
      0 responses
      3 views
      0 likes
      Last Post The_Sec
      by The_Sec
       
      Working...
      X