• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

minimum or maximum rounded

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

    minimum or maximum rounded

    hi, anyone can suggest me how to code
    for minimum or maximum rounded.


    the code already exists, or I have to create me?

    thanks..

    #2
    Hello,

    Thank you for the question.

    Rounding can be accomplished using the Math.Round method: https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx
    Also the Math.Min and Math.Max can be used here :
    https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx
    https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx

    Code:
    double value1 = Math.Round(12.3456,2);
    double value2 = Math.Round(15.3332,2);
    
    double minValue = Math.Min(value1, value2);
    double maxValue = Math.Max(value1, value2);
    
    //outputs minValue 12.35 maxValue 15.33

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      i mean that pics.....
      Attached Files

      Comment


        #4
        Hello esignal,

        Thank you for your response.

        I am not familiar with an indicator that plots in such a manner. It would seem you would need to implement your own code for this type of plotting.
        Patrick H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ptertich, Today, 07:56 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by aslane, Today, 08:24 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by Capablanca, Yesterday, 05:51 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by jackt, Today, 07:43 AM
        3 responses
        13 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by zachiatrist, Today, 07:11 AM
        3 responses
        9 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Working...
        X