I started this question in this thread: https://ninjatrader.com/support/foru...70#post1176670
And was advised to create a separate thread.
I want to automate everything as much as possible, and, with swing trading micro E-mini futures, once in 3 months I would need to roll-over positions.
My main struggle is with at the point of roll-over.
According to rollover calendar (https://www.cmegroup.com/trading/equ...rolldates.html), next rollover date is 9th of December, 2021. So at this date I would want to exit any open positions and open all subsequent positions for next contract, in this case, MES 03-22 (until it rolls over at 10th of March, 2022).
My idea around this is:
if (Bars.IsFirstBarOfSession && NextRollOverDate == Time[0].Date) // Where NextRollOverDate is DateTime variable, set to be Next Roll Over Date { ExitLong(); ExitShort(); NextRollOverDateCode = "03-22"; // MM-YY Code Of Next Contract CurrentSymbol = "MES " + NextRollOverDateCode; // Idea is to calculate the result of "MES 03-22", not sure if it's correct? }
Comment