Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Perform calculations "once"

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

    #16
    Originally posted by NinjaTrader_Josh View Post
    Please also consider Round2TickSize: http://www.ninjatrader-support.com/H...2TickSize.html
    Hey Josh, I'm not sure how to code this, can you help me with an example?

    The link says:
    Syntax
    Instrument.MasterInstrument.Round2TickSize(double price)

    I'm not sure if I apply this to all the times that I am using a variable that has to do with price, such as I would do with Koganams example.

    Comment


      #17
      Hi sauer11155,

      You have a double value. Any time you want to round it up to the instrument's tick size you need to use it. Otherwise if you already finished all calculations you can just set the double value to take on the rounded value and then you can call the double value directly.

      Code:
      double value = 133.23901903;
      value = Instrument.MasterInstrument.Round2TickSize(value);
      Josh P.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      599 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      344 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      558 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      557 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X