Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calculation equities - currencies

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

    Calculation equities - currencies

    Hello,

    I was experiencing a strange plotting as result from a simple calculation and worked round all day with it to find the reason The issue is that the calculation works for ES, NQ, YM but not for 6E, 6B...

    Now I found out that when I remove the "Math. Round" then the result is OK also with 6E and 6B. What is the reason for this please?

    Example: the NT Indicator "samplegethighlowbytimerange" I calculate the mid from the highestHigh and the lowestLow with rthMid = Math.Round((highestHigh+lowestLow)/2,2);
    And the result from is ok for ES.... but for 6E and 6B I have to use rthMid = (highestHigh+lowestLow)/2); for having a correct number from this calculation.

    Why please?

    Thank you!
    Tony

    #2
    Hello tonynt,

    Thank you for your post.

    If you would like to round a number in a NinjaScript it is suggested to use the NinjaScript method RoundToTickSize. RoundToTickSize returns a value that is rounded up to the nearest valid value evenly divisible by the instrument's tick size.

    Please see the example script in the NinjaTrader help guide documentation linked below for how this could be used.

    SampleRoundToTickSize - https://ninjatrader.com/support/help...he_nearest.htm

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by trilliantrader, Today, 03:01 PM
    2 responses
    17 views
    0 likes
    Last Post helpwanted  
    Started by ScottWalsh, Today, 06:52 PM
    2 responses
    16 views
    0 likes
    Last Post ScottWalsh  
    Started by cre8able, Today, 07:24 PM
    0 responses
    1 view
    0 likes
    Last Post cre8able  
    Started by Haiasi, Today, 06:53 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by ScottW, Today, 06:09 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Working...
    X