Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 inanazsocial, Today, 01:15 AM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by rocketman7, Today, 02:12 AM
      0 responses
      6 views
      0 likes
      Last Post rocketman7  
      Started by dustydbayer, Today, 01:59 AM
      0 responses
      1 view
      0 likes
      Last Post dustydbayer  
      Started by trilliantrader, 04-18-2024, 08:16 AM
      5 responses
      22 views
      0 likes
      Last Post trilliantrader  
      Started by Davidtowleii, Today, 12:15 AM
      0 responses
      3 views
      0 likes
      Last Post Davidtowleii  
      Working...
      X