Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is there a function that calculates round numers?

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

    Is there a function that calculates round numers?

    Hi,

    Is there a function (or a procedure) that calculates round numers?.

    For example, when EURUSD is at 1.4222, then I want to set a EnterlongStop order with price value of the first multiple of 0,0010. In this case at 1,4230.

    Or at the first multiple of 0,0100. In the same case at 1,4300.

    Thanks a lot in advance.

    #2
    Hi "CJS",

    You can use Math.Round for this. Something like...
    Code:
    Math.Round(1.4222, 3)
    More info at - http://msdn.microsoft.com/en-us/library/as4h66hd.aspx
    TimNinjaTrader Customer Service

    Comment


      #3
      I believe you can use the Math.Round() function provided by .NET

      Info here. Focus on this overloaded method.

      hope this helps.
      mrlogik
      NinjaTrader Ecosystem Vendor - Purelogik Trading

      Comment


        #4
        Thanks a los for the quick replies!!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        64 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        35 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        59 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        51 views
        0 likes
        Last Post CarlTrading  
        Working...
        X