Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Wrong TickSize / Price

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

    Wrong TickSize / Price

    Hello! I have an issue calculating GC difference.
    F.e. I'm trying to calculate Current Ask and Bid price. And it shows me the value not as 0.1, it shows 0,099999999999
    For example in my code there is a diffirence between Ask and Bid >= 3. And it Prints me true and Prints this value: 0,200000000000045
    How to resolve this problem?

    F.e. When I'm trying to calculate on NQ - it works great

    Thanks.

    #2
    Taking Time to Trade More Than Just Stocks. The ways traders trade are varied. Some are day traders, while others are swing traders and position traders. Although many of the tools they use are the same or similar, each variety of trader works within differing time frames to reach goals that are specific to the type of trades they’re making.
    Last edited by JonasZweig; 07-27-2021, 06:30 AM.

    Comment


      #3
      Hi YevhenShynkarenko, thanks for your post.

      To get the current ask or bid at any time use GetCurrentAsk or GetCurrentBid. In the NinjaScript library, we have RoundToTickSize to round a value up to the next value divisible by the instruments tick size.

      .NET also has the Math.Round method, documented here.

      Please let me know if I can assist any further.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      68 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      151 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      100 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      288 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X