Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to determine when contract has rolled over

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

    How to determine when contract has rolled over

    I'm using following chart:
    * Intraday chart (e.g., Renko)
    * Instrument of EMD 12-10 with default session template (which is CME US Futures RTH I believe)
    * Merge policy is set for MergeBackAdjusted

    I'm trying to determine the boolean logic to detect when we've rolled over to new contract within a continuous contract intraday chart that auto-merges many contracts per the merge policy setting. I want to detect this historically via the indicator if possible so I can see the precise first bar in my chart for a newly rolled over contract (e.g., in March, June, Sept, Dec for index type futures).

    I've tried a couple of ideas - like Bars.TotalTicks or Bars.TickCount for the variable to check against but still no luck, for example:

    Code:
    if (Bars.TotalTicks > 1)   //<---- Not sure of if expression here to detect rolled over contract
        //Found first bar of new contract that we've rolled over/merged into on this chart
        Print(String.Format("Rolled Over Contract Detected with {0} on TickCount {1}, Bar {2},  [{3}]", 
                Instrument.FullName, Bars.TickCount, CurrentBar, Time[0]));
    Maybe the problem I have is using RTH session template instead of ETH. If anyone has other ideas on how to accomplish rollover detection in the past within a continuous contract which uses merging, I'd be grateful in hearing your solution

    JD

    #2
    JD, unfortunately you could not programmatically access the rollover dates defined. You can perhaps add the dates yourself to the script for example as StringSeries and then check off against this.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    571 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    548 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    549 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X