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, 05-11-2026, 05:56 AM
      0 responses
      58 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      34 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      196 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      362 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      281 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X