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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      574 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      332 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      553 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X