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 SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      47 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      22 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      15 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      21 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      23 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X