• 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

Round2TickSize not working

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

    Round2TickSize not working

    Hi,

    The Round2TickSize suddenly stops to work for my script. It is unable to round the number to the nearest tick today. It was still working yesterday and I have not done anything to the script itself. The script is as follows:

    protected override void Initialize()
    {
    CalculateOnBarClose = false;

    hPrice = Instrument.MasterInstrument.Round2TickSize(1.0005 * refHigh) + 2;
    lPrice = Instrument.MasterInstrument.Round2TickSize(0.9995 * refLow) - 2;

    Print("hPrice: " + hPrice);
    Print("lPrice: " + lPrice);
    }

    When I print the hPrice and lPrice of say SPI, it is not rounded to nearest tick size of 1. Can you pls help? thanks.

    #2
    Ok, an error with the symbol, got it working. thks.

    Comment


      #3
      Hello lengguan,

      Thank you for your post.

      What was the resolution here? What was the error with the symbol?
      Patrick H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by tornadoatc, Today, 10:31 AM
      0 responses
      0 views
      0 likes
      Last Post tornadoatc  
      Started by EnveousColnago, Yesterday, 05:43 PM
      4 responses
      24 views
      0 likes
      Last Post marcus2300  
      Started by Vypre, 11-23-2018, 07:51 AM
      2 responses
      42 views
      1 like
      Last Post fx.practic  
      Started by AMATX, Yesterday, 09:29 AM
      7 responses
      39 views
      0 likes
      Last Post AMATX
      by AMATX
       
      Started by Johnny Santiago, Yesterday, 06:18 PM
      1 response
      9 views
      0 likes
      Last Post Johnny Santiago  
      Working...
      X