Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bug in your merge code somewhere with CL - try this today

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

    Bug in your merge code somewhere with CL - try this today

    I am connected to Zen-Fire, although this also happens with an IQFeed connection.

    Try this out today:

    If you select CL 03-11 as the contract and set to "MergeBackAdjusted", everything works fine. You can load as many days/hours/minutes/ticks of data that you want, and it correctly merges the data and displays it on the chart. All of the latest data is also shown properly.

    However, if you now switch to CL 04-11, you get a funny situation where the last "X" bars of data are simply not shown and there is a discrete "jump" between some past data and the currently traded price. In fact, it looks almost as if the data loads fine for CL 03-11, and then no data for CL 04-11 is loaded, but the currently trading price for CL 04-11 is of course live.

    Reloading historical data does nothing to help the situation. What seems to work is selecting "DoNotMerge" for the CL contract... at that point, you get all the latest data correctly for CL 04-11. Of course, you cannot then create charts which go back more than a certain period of time because there is no merge, which is limiting.

    This effect is happening today, and it is happening while connecting to both IQFeed, and to the Zen-Fire historical data servers. So it's not a server issue, it's a code issue. I have a feeling that this has to do with the fact that CL 03-11 is technically still the front-month (the software auto-selects that month in the instrument manager when you click on CL in the list).

    I think that there could be a bug related to the fact that you are trying to MergeBackAdjusted with a contract month that is not the current front month, but that the softare thinks is in the future. You can try this out today for yourselves and see what you get... I suspect that it is a bug somewhere in the code.

    Thanks!

    EDIT: I am on 7.0.0.2, but this has been happening with many prior versions.

    EDIT #2: IQFeed is also setting the front month to CL 04-11 today when you select the continuous contract, which is appropriate since CL 04-11 is trading more volume than 03-11 as of the last 24 hours. However, NT is still setting 03-11 as the front month when you select the contract in instrument manager. Perhaps you can check if maybe 04-11 should actually be listed as the front month as of today, the same as what IQFeed seems to be doing? It seems to be a little early according to the rollover rules that I know, but it seems to be happening....
    Last edited by JS999; 02-17-2011, 09:30 AM.

    #2
    Hello JS999,

    Thanks for your post.

    This is not a bug in the function, but an expected result until the roll-over date programmed in the instrument manager is hit.

    In the case of CL, the roll-over date to the 04-11 contract programmed in to the Instrument Manager is 2/21. As a result of this, the 04-11 chart will show historical data from the 03-11 contract until the 21st.

    This can be addressed in a few different ways:

    1.) You can change the merge policy (Tools > Options > Data tab) for the next few days to 'DoNotMerge'.

    2.) You can change the defined roll-over date in the instrument manger:
    1. Open the manager by clicking Tools > Instrument Manager.
    2. Select CL from the list on the right, then press Edit.
    3. Navigate to the Misc tab of the Instrument Editor and scroll down to the bottom of the window.
    4. Click the '...' button next to 'Contract Months'.
    5. Select the 04-11 roll over and define a new roll-over date, then click OK to apply your changes.
    KyleNinjaTrader Customer Service

    Comment


      #3
      Hello

      as I had the same experience with CL 04-11 and CL 03-11 today,

      now I understand.


      I have another question concerning the rollover dates (for CL in this case):

      What about the offset parameter in the rollover definition?

      How can I force NT7 to recalculate the offfset in case I change the rollover date?

      Or do I have to do this by hand?

      regards
      Andreas
      zweisteintrading.eu

      Comment


        #4
        Hello zweistein,

        This value should populate automatically on the date of the roll-over defined in the Instrument Manager.
        KyleNinjaTrader Customer Service

        Comment


          #5
          Thanks, this seems to work. Regarding the offset field previously, it just seems to be blank. This is correct, I am assuming? (I set the rollover to today's date, and it remains blank.)

          Comment


            #6
            Hi JS999,

            It should populate once a chart is reloaded with the merge policy set to merge and back-adjust.
            KyleNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Kyle View Post
              Hi JS999,

              It should populate once a chart is reloaded with the merge policy set to merge and back-adjust.
              Thanks, that seems to work!

              Comment


                #8
                One more thing, while we are on this topic:

                As I mentioned, IQFeed's continuous contract is setting the front month to CL 04-11 as of today. In addition, 04-11 is trading 153k volume today vs. 03-11 which is only 85k. In other words, the volume is rolling over to the next month as of today and IQFeed is therefore selecting today as their "rollover" date.

                According to the rollover rules I know for CL, rollover happens 3 business days before the 25th of the month prior to the contract month. (However, if the 25th is a non trading day, i.e. a weekend, last trading day is 3 business days before the first trading preceding the 25th.)

                That would imply something like the 21st to be the rollover date, which you guys have in your settings. So why is the volume rolling over today, and why would IQFeed by picking up on that and setting their continuous contract to show 04-11 instead of 03-11 data if rollover isn't supposed to happen for another few days? Is there some change I am not aware of? By the time the 21st hits, there will be very little volume left in 03-11 at this rate, which means that tomorrow will be a bit screwed up for those people that don't realize it and continue to use NT's default settings for the front month. Any ideas?

                Comment


                  #9
                  Hi JS999,

                  The continuous contract provided by IQ will roll to the next expiry on whichever date they choose - this isn't something effected by merge policy settings within NinjaTrader.

                  Unfortunately, I can offer no clarification on the transfer of volume.
                  KyleNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by bc24fl, 08-30-2019, 01:58 PM
                  4 responses
                  258 views
                  0 likes
                  Last Post PaulMohn  
                  Started by sugalt, Today, 04:02 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post sugalt
                  by sugalt
                   
                  Started by tradingnasdaqprueba, 04-09-2024, 09:52 AM
                  6 responses
                  29 views
                  0 likes
                  Last Post tradingnasdaqprueba  
                  Started by PaulMohn, Today, 02:06 AM
                  1 response
                  3 views
                  0 likes
                  Last Post PaulMohn  
                  Started by Mindset, Today, 01:27 AM
                  0 responses
                  5 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Working...
                  X