Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
      Chris L.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by pechtri, 06-22-2023, 02:31 AM
      9 responses
      122 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by frankthearm, 04-18-2024, 09:08 AM
      16 responses
      64 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by habeebft, Today, 01:18 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by benmarkal, Today, 12:52 PM
      2 responses
      13 views
      0 likes
      Last Post benmarkal  
      Started by f.saeidi, Today, 01:38 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X