Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Round to Next To Nearest Tick

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

    Round to Next To Nearest Tick

    Hey Guys I have code
    Code:
    roundedClose = Instrument.MasterInstrument.Round2TickSize( (Close[0])) ;
    		DrawTextFixed("Round", roundedClose.ToString(), TextPosition.TopRight, Color.Black, new Font ("Arial", 14), Color.Empty, Color.Empty,0);
    My chart is set EUR/USD (TenthOfAPiP) so I get number like 1.06978 but I want to display the nearest Pip not Pipette. How would I do this? so that if the Close[0] = 1.06978 ; I'll get 1.0698?

    What do I have to change? thank you

    #2
    Hello ginx10k,

    Thanks for your post.

    Try:

    Code:
    DrawTextFixed("Round", roundedClose.ToString("0.0000"), TextPosition.TopRight, 
    			Color.Black, new Font ("Arial", 14), Color.Empty, Color.Empty,0);

    Comment


      #3
      That's great for Writing the String. Thanks so much. HOWEVER,

      How do I get that value now so I can use it in another variable. or in the same variable. I want that roundedClose the same as it displays, I want the value in a variable.

      Comment


        #4
        Hello ginx10k,

        Thanks for your reply.

        Math.Round(number to round, decimals wanted) would meet your needs.

        newrounded = Math.Round(roundedClose, 4);

        Comment


          #5
          Great. thanks a lot!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          574 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          333 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X