Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

input as array

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

    input as array

    Hello

    I'm doing a strategy which needs 64 groups of 4 inputs, so I wanna put them in 4 arrays. My doubt is how could I declare the array so that I can optimize them.

    Thanks four your help

    #2
    Hello etruria,

    Thank you for the question.

    For a property to be optimized, it would need the NinjaScriptAttribute tag and also be a type that can be optimized. You can find an example here:


    If you want groups, that is easily configurable with the Display attribute and the GroupName. You could place the same group over 4 different properties and they would become the same group in the user interface. https://ninjatrader.com/support/help...yattribute.htm

    You noted you want to use 4 arrays, but you also noted you have 64 input groups, are you intending to further group the 4 inputs from each of the 64 groups into the 4 other arrays you mentioned? Can you provide more detail on how you want the optimizer to iterate over the groups of properties in more detail?

    The optimizer can only optimize ranges of values over individual properties with the NinjaScriptAttribute. If you need to optimize a whole group at once, like the array you are speaking of you may need to handle that with logic in your script. I would need more details to provide more relevant help in this case.

    I look forward to being of further assistance.

    Comment


      #3
      Sorry, there are 4 groups of 64 inputs, that groups are loss stops and gain stop and two more things

      Comment


        #4
        Hello,

        Thank you for the reply.

        In that case, you can do that with just the display attribute and GroupName property. The help guide has an example of one property, you would replicate this for all properties and make the group name reflect the group the property should be in.

        The NinjaScriptAttribute would also be used so the property shows up in the optimizer. Once you add those two attributes, you would get optimizable properties in various groups of your choosing.

        Code:
        [NinjaScriptProperty]
        [Display(Name="Target1", Order=1, GroupName="FirstTargets")]
        public int Target1
        { get; set; }
        
        [NinjaScriptProperty]
        [Display(Name="Target2", Order=2, GroupName="FirstTargets")]
        public int Target2
        { get; set; }
        
        [NinjaScriptProperty]
        [Display(Name="Target3", Order=3, GroupName="FirstTargets")]
        public int Target3
        { get; set; }
        
        [NinjaScriptProperty]
        [Display(Name="Target4", Order=4, GroupName="FirstTargets")]
        public int Target4
        { get; set; }

        I look forward to being of further assistance.

        Comment


          #5
          I think its late but maybe the Series type of NinjaScriptProperty would works for your case:


          Code:
                  
                  [Browsable(false)]
                  [XmlIgnore]
                  public Series<int> yourArray
                  {
                      get
                      {return Values[0];}
                  }

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          50 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          126 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          69 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X