I have a strategy and I would like to make a test to add an automatic "rollover position" in a futures contract without re-configuring the Strategy parameters by adding these conditions:
Example E-Mini 03-24 to 06-24 - I have the strategy running on the ES 03-24
- 2 days before the 03-24 Contract expiration I set the Strategy to close the current position on the 03-24 and (Re) Open it in the 06-24;
- Automatically update the Instrument in my strategy to now track the 06-24 instead of 03-24
How can it be achieved via code? Is there any example I can follow?
Thank you in advance.
Comment