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

Rollover price offset calculation

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

    Rollover price offset calculation

    Can you please shortly explain how exactly is rollover price-offset calculated by NT?

    I understand the general logic behind rollover handling, and I would expect, that the first open from both contract-months is taken at the rollover-date and the price-difference is the offset between those 2 contract-months.

    Some of the rollover offset prices in NinjaTrader I can calculate using steps above, but some are just not reproducible or I am calculating something wrong..

    For example:
    • 6E 09-13 has rollover to 6E 12-13 on 13.09.2013
    • First open-price this date on 6E 09-13 is 1.3284
    • First open-price this date on 6E 12-13 is 1.3287
    • Real difference is 3 ticks


    But in the settings for 6E, there is 5 ticks offset...
    Cannot understand, how exactly is it calculated?

    I tried calculate it from previous closes, .. but nothing works consistently.
    I always find many cases, where it is not stable...

    So how should I calculate the offsets, to get same exact values, that are set in NinjaTrader?
    It finally looks for me like the offset values are predefined and are not dynamically calculated from the 1-minute bars.
    Last edited by misova; 08-31-2014, 01:25 PM.

    #2
    Hello misova,

    Thank you for your post.

    I will check with our development team to see how the rollover offset is calculated.

    Comment


      #3
      Rollover offsets are calculated from the closing prices or the settlement prices of the day prior to rollover date. The formula is

      offset = closing / settlement price new front month - closing/ settlement price old front month

      -> positive offset: amount is added to old front month for backadjustment
      -> negative offset: amount is subtracted from old front month for backadjustment

      NinjaTrader

      NinjaTrader handles offset as follows:

      (1) If offset is available on NinjaTrader server for the chosen rollover date, NinjaTrader will automatically download this offset. If you change it to something else, NinjaTrader will override your chosen offset and download the value again. This is very bad, because the NinjaTrader database for offsets is not properly maintained for some instruments. Also NinjaTrader calculates the offsets from the regular close instead of the settlement price.

      (2) If no offset (1) is available, NinjaTrader will calculate the offset from the daily data. For example with Kinetick or DTN/IQ data, your offset will be calculated from the settlement prices, because that is what Kintick and DTN/IQ supplies. With Rithmic or CQG data your offset will be calculated from the regular close. However, in this case you have the option to override the offset manually. The manually selected value will be maintained in the database, if there is no value on the Ninjatrader servers.

      (3) If no offset (1) and no daily (2) is available, NinjaTrader will automatically calculate the offset from intraday data.

      Rollover for 6E on September 13, 2013

      Settlement price for 6E 12-13 for September 12: 1.3308
      Settlement price for 6E 09-13 for September 12: 1.3304

      The correct rollover offset would be 4 ticks.

      If you calculate the rollover offset from the regular closes at 2:00 PM CT, you would get

      Regular close for 6E 12-13 for September 12: 1.3308
      Regular close for 6E 09-13 for September 12: 1.3303

      The rollover offset calculated from the regular closes would be 5 ticks. This is the value stored on the NinjaTrader servers.


      Entering a value manually

      If you keep the correct rollover data September 13, you cannot enter the correct value manually. NinjaTrader will always override your manually entered value with the value stored in its database.

      In this case, if you wish to enter the correct value of 4 ticks, you need to change the rollover date to September 12. Now you can enter the correct value manually, and because there is no rollover data sitting on the NinjaTrader servers for September 12, it will not be removed.

      I very much hope that this procedure changes with NinjaTrader 8!

      Comment


        #4
        Thank you very much.
        You provided us with really useful and detailed explanation.

        Just to make sure:
        In the provided example, where final correct rollover offset was 4 ticks,
        you had a look at bar 13.9.2013 at 13:59 Central Time?
        (which is 1 minute before official rollover time which is set 13:59:30 - 14:00:00 Central Time)

        The calculation of price offset is then fully clear, and if the rollover date is setup,
        I can calculate the correct rollover offset (if not fixed by datafeed of NT database).

        Thank you!

        -----------------------------------------------------------------------------------------------------------

        The question remaining is just how NinjaTrader selects the rollover dates?

        For 6E it is almost always Friday, which is the real date, when the volume are bigger on new contract than on old contract.

        If most of the rollover dates would be Friday, that would be clear for me.
        And it could be also Thursday sometimes, if the Friday is some Holiday.
        But it is very different per case.

        In the NinjaTrader settings I found rollover dates, that I cannot understand:
        - there are too many Thursdays (1 days sooner, than expected Friday)
        - also some Wednesdays (2 days sooner)
        - also some Tuesdays (3 days sooner)

        Examples - rollovers for 6E taken from NT:
        (environment is NinjaTrader & CQG datafeed)
        Look just at the lines in red. All others without note, they are standard Fridays.


        6E
        ROLLOVER DATE | OFFSET
        -------------------------------------------------
        2016-09-16
        2016-06-10
        2016-03-11
        2015-12-11
        2015-09-10 (Thursday 1 day sooner, than expected Friday)
        2015-06-12
        2015-03-13
        2014-12-12
        2014-09-12
        2014-06-13 | 0.0002
        2014-03-14 | -0.0001
        2013-12-13 | -0.0001
        2013-09-13 | 0.0005
        2013-06-14 | 0.0007
        2013-03-15 | 0.0006
        2012-12-14 | 0.0011
        2012-09-10 | 0.0011 (Monday, 4 days sooner)
        2012-06-15 | 0.0009
        2012-03-16 | 0.0006
        2011-12-16 | 0.0012
        2011-09-16 | -0.0014
        2011-06-10 | -0.0042 This is some crazy rollover offset - much bigger than all round
        2011-03-11 | -0.0018
        2010-12-10 | -0.0006
        2010-09-10 | -0.0003
        2010-06-11 | 0.0008
        2010-03-11 | -0.0001 (Thursday 1 day sooner) OK - Veterans Day
        2009-12-11 | -0.0004
        2009-09-10 | 0.0000 (Thursday 1 day sooner)
        2009-06-11 | -0.0014 (Thursday 1 day sooner)
        2009-03-12 | 0.0003 (Thursday 1 day sooner)
        2008-12-12 | -0.0031
        2008-09-12 | -0.0070
        2008-06-12 | -0.0070 (Thursday 1 day sooner)
        2008-03-13 | 0.0000 (Thursday 1 day sooner)
        2007-12-12 | 0.0008 (Wednesday 2 days sooner)
        2007-09-13 | 0.0036 (Thursday 1 day sooner)s
        2007-06-14 | 0.0039 (Thursday 1 day sooner)
        2007-03-14 | 0.0048 (Wednesday 2 days sooner)
        2006-12-13 | 0.0054 (Wednesday 2 days sooner)
        2006-09-13 | 0.0066 (Wednesday 2 days sooner)
        2006-06-14 | 0.0075 (Wednesday 2 days sooner)
        2006-03-09 | 0.0071 (Thursday 1 day sooner)



        So my question is:
        How rollover dates are chosen? Based on what rules/criteria?

        Comment


          #5
          Originally posted by misova View Post

          Just to make sure:
          In the provided example, where final correct rollover offset was 4 ticks,
          you had a look at bar 13.9.2013 at 13:59 Central Time?
          No, as I explained, you need to take the bar 12.9.2013 (last trading day prior to rollover day) at 14:00 Central Time (regular close). Alternatively you can use the settlement price for the trading day prior to rollover as published by the exchange (comes with daily data by Kinetick or DTN/IQ).


          Originally posted by misova View Post

          So my question is:
          How rollover dates are chosen? Based on what rules/criteria?
          For some financial futures there are "official" rollover dates. Please consult the CME website for further information. For physical commodities the rollover date is usually chosen based on volume crossover - that is rollover day is the first day where the trading volume of the new front month contract exceeds the volume of the old front month contract.

          Comment


            #6
            Originally posted by Harry View Post
            For some financial futures there are "official" rollover dates. Please consult the CME website for further information.
            Thank you - I found official rollovers here:
            http://www.cmegroup.com/trading/fx/rolldates.html

            I compared them and found, that NinjaTrader uses different rollover dates, than are these official CME FX Quarterly Roll Dates.

            For example 6E:
            • CME official roll date is: 11.3.2013
            • NinjaTrader has setup: 14.3.2013


            Almost all other rollover dates are different, what brings me to the
            idea, that NinjaTrader does not use these "official" CME roll dates.
            There have to be some some another logic...

            General note:
            Almost all traders want to trade the most liquid contract, so they roll their positions the last Friday before the expiration of the contract,
            and that is also a point, where volumes on newer contract becomes bigger than on older.
            NinjaTrader does a (partially - some dates are good, some not) good job,
            that it really chose the last Friday (also 14.3.2013 is Friday) as the rollover date
            and it is general and common rolling method.


            I want to say, that the official CME rollover dates are not commonly used by traders for quarterly rolling contracts.

            So the question still remains:
            If NinjaTrader does not use the official CME roll dates, what is the method how rollover dates are chosen?
            Last edited by misova; 09-01-2014, 10:08 AM.

            Comment


              #7
              Originally posted by misova View Post
              Thank you - I found official rollovers here:
              http://www.cmegroup.com/trading/fx/rolldates.html

              I compared them and found, that NinjaTrader uses different rollover dates, than are these official CME FX Quarterly Roll Dates.

              For example 6E:
              • CME official roll date is: 11.3.2013
              • NinjaTrader has setup: 14.3.2013


              Almost all other rollover dates are different, what brings me to the
              idea, that NinjaTrader does not use these "official" CME roll dates.
              There have to be some some another logic...

              General note:
              Almost all traders want to trade the most liquid contract, so they roll their positions the last Friday before the expiration of the contract,
              and that is also a point, where volumes on newer contract becomes bigger than on older.
              NinjaTrader does a (partially - some dates are good, some not) good job,
              that it really chose the last Friday (also 14.3.2013 is Friday) as the rollover date
              and it is general and common rolling method.


              I want to say, that the official CME rollover dates are not commonly used by traders for quarterly rolling contracts.

              So the question still remains:
              If NinjaTrader does not use the official CME roll dates, what is the method how rollover dates are chosen?
              Ask the guys from NinjaTrader. But in the end this is irrelevant. You need to decide which rollover date you wish to use and then enter that date into the instrument manager.

              You do not need to stick with the preset roll dates.

              Comment


                #8
                Originally posted by Harry View Post
                Ask the guys from NinjaTrader. But in the end this is irrelevant. You need to decide which rollover date you wish to use and then enter that date into the instrument manager.

                You do not need to stick with the preset roll dates.
                Oh, sorry, I really have to ask NinjaTrader guys
                But your answer was so precise and professional that I have naturally read it as an answer from support
                Sorry, my mistake...
                So we will have to wait for real Ninjas

                Yes you are right, there is no need to stick with the NT rollovers.

                I am just really interested, if I need to reconfigure many of the wrong predefined
                rollovers or they are OK...
                Last edited by misova; 09-01-2014, 10:47 AM.

                Comment


                  #9
                  Originally posted by misova View Post
                  I am just really interested, if I need to reconfigure many of the wrong predefined rollovers or they are OK...
                  There are not many "wrong" predefined rollovers. NinjaTrader offers you preset rollover dates and offsets, mostly based on volume crossover and the regular close. This can not be considered "wrong", but is one out of several possible options. If you do not like those preset values, it is up to you to select different rollover dates and offsets.

                  There are only a few cases, where the rollover offsets supplied from the NinjaTrader servers have been erroneously set to "0" . Those offsets are indeed wrong. The case that you mentioned - 6E - follows one of the possible options and as such is correct.

                  You can also look at the rollover dates used by data providers such as CSI or Pinnacle Data, and you will find that the selected rollover dates are often different. For many commodities there is no such thing as the one and only possible rollover date.
                  Last edited by Harry; 09-01-2014, 02:31 PM.

                  Comment


                    #10
                    Thanx, I understand...

                    It would be really nice to find some consistency in choosing rollover dates.
                    Hopefully NinjaTrader guys put some more light to this...

                    Comment


                      #11
                      Hello misova,

                      Thank you for your response.

                      It actually is the exchange listed date, but these change. You can customize and set your rollover dates at any time, please take a look at the video at the following link: https://www.youtube.com/watch?v=zzXBE2Jheog

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by helpwanted, Today, 03:06 AM
                      1 response
                      7 views
                      0 likes
                      Last Post sarafuenonly123  
                      Started by Brevo, Today, 01:45 AM
                      0 responses
                      7 views
                      0 likes
                      Last Post Brevo
                      by Brevo
                       
                      Started by aussugardefender, Today, 01:07 AM
                      0 responses
                      5 views
                      0 likes
                      Last Post aussugardefender  
                      Started by pvincent, 06-23-2022, 12:53 PM
                      14 responses
                      242 views
                      0 likes
                      Last Post Nyman
                      by Nyman
                       
                      Started by TraderG23, 12-08-2023, 07:56 AM
                      9 responses
                      385 views
                      1 like
                      Last Post Gavini
                      by Gavini
                       
                      Working...
                      X