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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      47 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      23 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      51 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X