Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Set Order in #region properties incrementally

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

    Set Order in #region properties incrementally

    Hello,

    I am trying to use the increment operator so I don't have to retype the Order number each time I move or create new properties. So I would like to do something like:


    int order = 1;

    [Range(1, int.MaxValue), NinjaScriptProperty]
    [Display(ResourceType = typeof(Custom.Resource), Name = "Slow", GroupName = "NinjaScriptStrategyParameters", Order = order++)]
    public int Slow { get; set; }


    and so on. But I get always errors. Is there a way to achieve that (or something similar so that I don't have to retype the order number each time)? Thanks !
    Last edited by roblogic; 05-18-2019, 04:12 AM. Reason: better format

    #2
    Originally posted by roblogic View Post
    Hello,

    I am trying to use the increment operator so I don't have to retype the Order number each time I move or create new properties. So I would like to do something like:


    int order = 1;

    [Range(1, int.MaxValue), NinjaScriptProperty]
    [Display(ResourceType = typeof(Custom.Resource), Name = "Slow", GroupName = "NinjaScriptStrategyParameters", Order = order++)]
    public int Slow { get; set; }


    and so on. But I get always errors. Is there a way to achieve that (or something similar so that I don't have to retype the order number each time)? Thanks !
    The exact text of the error message might help point to a resolution or reason.
    Last edited by koganam; 05-21-2019, 07:52 PM.

    Comment


      #3
      Hello roblogic,

      I'm not certain that something like this will not be possible.

      As far I know, you will need to manually give the properties the proper Order number for their position in the UI properties window. If you set them all to 0 they will be listed alphabetically.
      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      87 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      134 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      118 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X