Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to calculate ticks

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

    How to calculate ticks

    Hello,

    I just try to implement MoneyManagement filter for the custom strategy.
    And if initial risk of the entry is more than lets say 10 ticks --> skip that signal.

    For this I have to calculate somehow difference between two prices in ticks. How could I do this?
    Would be grateful for any advise or sample.

    #2
    Hello akushyn,

    Thanks for your note.

    When you have two prices that are exact tick sizes, these can be divided by the TickSize property.
    Use Math.Abs() to ensure you have a positive number.

    For example:
    Code:
    Print( Math.Abs(High[0] - Low[0]) / TickSize );
    
    if (( Math.Abs(High[0] - Low[0]) / TickSize > 10)
    {
    // execute code
    }
    Below is a link to the help guide on TickSize.
    http://ninjatrader.com/support/helpG...7/ticksize.htm


    If you are using two prices that do not have exact tick sizes, you can optionally use Instrument.MasterInstrument.Round2TickSize() to round these before dividing by the tick size.
    http://ninjatrader.com/support/helpG...trument_ro.htm
    Code:
    Print( Instrument.MasterInstrument.Round2TickSize(Math.Abs(SMA(High, 14)[0] - SMA(Low, 14)[0])) / TickSize );
    Last edited by NinjaTrader_ChelseaB; 06-24-2016, 02:23 PM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Very useful, thank you!

      And now, how to calculate risk in US dollars , cause some intsruments valued in EUR and some in USD? How to convert from EUR to USD ?

      Is there smth like TickValue?
      usdRisk = calculatedTicks * TickValue

      Comment


        #4
        Hello akushyn,

        There is a point value: Instrument.MasterInstrument.PointValue.

        For example on the ES the point value is 50. The tick size is .25. You can calculate the price per tick with (TickSize * Instrument.MasterInstrument.PointValue). For the ES this would be 12.5 per tick.

        Converting to different currencies would require a custom calculation. You may need a secondary series of forex data to get the current conversion rate between two currencies.
        There is not a function in NinjaTrader to return this information.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        597 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        556 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        555 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X