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 love2code2trade, Yesterday, 01:45 PM
      4 responses
      28 views
      0 likes
      Last Post love2code2trade  
      Started by funk10101, Today, 09:43 PM
      0 responses
      7 views
      0 likes
      Last Post funk10101  
      Started by pkefal, 04-11-2024, 07:39 AM
      11 responses
      37 views
      0 likes
      Last Post jeronymite  
      Started by bill2023, Yesterday, 08:51 AM
      8 responses
      45 views
      0 likes
      Last Post bill2023  
      Started by yertle, Today, 08:38 AM
      6 responses
      26 views
      0 likes
      Last Post ryjoga
      by ryjoga
       
      Working...
      X