• 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 Tradarr, Today, 06:25 PM
      2 responses
      13 views
      0 likes
      Last Post Tradarr
      by Tradarr
       
      Started by cocopod, Today, 04:47 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_JoshG  
      Started by digibob, Today, 02:47 AM
      2 responses
      14 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by mntemel, Today, 03:31 PM
      4 responses
      23 views
      0 likes
      Last Post mntemel
      by mntemel
       
      Started by mrlucky1x, Today, 03:14 PM
      2 responses
      7 views
      0 likes
      Last Post mrlucky1x  
      Working...
      X