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

range check

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

    range check

    hello, I have the following code in my properties section:

    [GridCategory("01. Test ")]
    [Gui.Design.DisplayNameAttribute("01. Test Value")]
    public int AutoRefreshHour
    {
    get { return testVal; }
    set { testVal= Math.Max(1, value); }
    }


    Is there a way I can check that the entered value is between 1 and 10 in this statement?

    thanks

    #2
    Hello FCatan,

    Thanks for your post.

    You can limit the input to be between 1 and 10 via:

    set { testVal= Math.Min (10, Math.Max(1, value)); }
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by alifarahani, 04-19-2024, 09:40 AM
    8 responses
    52 views
    0 likes
    Last Post alifarahani  
    Started by mmckinnm, Today, 01:34 PM
    2 responses
    4 views
    0 likes
    Last Post mmckinnm  
    Started by Conceptzx, 10-11-2022, 06:38 AM
    3 responses
    60 views
    0 likes
    Last Post NinjaTrader_SeanH  
    Started by f.saeidi, Today, 01:32 PM
    1 response
    2 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by traderqz, Today, 12:06 AM
    9 responses
    16 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X