Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

why is Math Max the result

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

    why is Math Max the result

    I am asking this question out of curiosity

    When I use the strategy wizard and enter a value in the "min" column of the user defined inputs the following code is generated by the wizard in the properties section:

    public int MyInput0
    {
    get { return myInput0; }
    set { myInput0 = Math.Max(4, value); }
    }

    I am curious why Math.Min is not used - since the 4 is a minimum value - not a Maximum value

    #2
    verge, Math.Max is needed here as you define lower min boundary, the 4 and the upper one is whatever the user enters for the input - in the end it uses the higher one of both, hence max is needed.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    46 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    14 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    21 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X