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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      56 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      132 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      73 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X