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

Is there a function that will return the Highest value of two inputs?

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

    Is there a function that will return the Highest value of two inputs?

    Howdy.

    I'm wondering if there is a way to compare two numbers, and have it return the highest value without using a bunch of 'IF' statements.

    The MAX() function seems to just compare the highest value over a set period. I would like to just input two numbers and have them output the highest value.

    Like:

    Code:
    value = someFunction(10,20)
    Where in this above, 'value' would have assigned to it the number 20 assigned to it since it is higher than 10.

    #2
    Disregard please. I see that I can just access the C# max function through:
    Code:
    Math.Max()
    The NT MAX() function was throwing me off.

    Comment


      #3
      forrestang,

      Glad to hear you were able to find a solution! Let us know if you need help with anything else.
      MatthewNinjaTrader Product Management

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by gravdigaz6, Today, 11:40 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by MarianApalaghiei, Today, 10:49 PM
      3 responses
      10 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by XXtrader, Today, 11:30 PM
      0 responses
      4 views
      0 likes
      Last Post XXtrader  
      Started by love2code2trade, Yesterday, 01:45 PM
      4 responses
      28 views
      0 likes
      Last Post love2code2trade  
      Started by funk10101, Today, 09:43 PM
      0 responses
      9 views
      0 likes
      Last Post funk10101  
      Working...
      X