Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Automatic Rollover

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

    Automatic Rollover

    Hi,

    Is there any way to rollover the instruments automatically? I would like to trade the latest contract without user interaction having an option in the strategy code SetDefauls section, for instance:
    Code:
    AutoRollover = True;
    so the strategies automatically trade the latest active contract.

    Thank You,

    Gustavo

    #2
    Hello Gustavo,

    NinjaTrader does not automatically change the instrument in any window. If a position was open on a previous contract month and NinjaTrader rolled the chart automatically to a newer contract month, you would not see that a position is still open on the previous contract month on that chart.
    Should the position stay open until the settlement date, typically would need to setup delivery of that commodity.
    As this could cause a lot of grief, NinjaTrader does not make any changes to your workspace.

    There is a single button that can rollover instruments in all windows of the workspace at the same time to make this easy. Tools > Database Management > Rollover.


    While not documented or supported, it is possible to use code to change the instrument on a chart.
    Below is a link to the rollover indications indicator.
    Shows a button on the chart to roll the expiry to the next available contract month. Option to hide button until a number of days before or on roll date. Another option to confirm by opening the instrument overlay selector or automatically rollover without confirmation. (Update June 27th, 2019 – Added an option to show […]


    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      How about programming an automated closing of all open positions if any 1 day prior to the roll date?
      Can it be done?

      I ask as a safety measure to prevent any possibility of required delivery for holding the contract into the expiry date.
      One never knows. Could have an accident and be away for 2 weeks or more into the expiry date.

      Do you have that safety measure already implemented in some way?

      Thank you.

      Comment


        #4
        Hello Cormick,

        Thank you for the post.

        You could use the available rollover indication indicator or logic from it. It has similar logic in it to check where a rollover happened to mark the chart.

        Code:
        Time[0].Date == Instrument.MasterInstrument.RolloverCollection[rollColIndex].Date)
        This is the line which checks the date, you could use similar logic to find 1 day before that date as well.




        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Waxavi, Today, 02:10 AM
        1 response
        16 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by Kaledus, Today, 01:29 PM
        5 responses
        13 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Waxavi, Today, 02:00 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by alifarahani, Today, 09:40 AM
        5 responses
        23 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by gentlebenthebear, Today, 01:30 AM
        3 responses
        17 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X