SmartQuant Discussion
http://www.smartquant.com/forums/

Strategy that simulates rolling futures as part of strategy
http://www.smartquant.com/forums/viewtopic.php?f=44&t=10856
Page 1 of 1

Author:  peek [ Sat Oct 18, 2014 5:46 pm ]
Post subject:  Strategy that simulates rolling futures as part of strategy

Hi there -

I have contract data for a certain futures contract spanning back 10yrs of time.
This contract continuously rolls each month over a several day time span.
I also have contract data for the calendar spreads for the 1st to 2nd month of that contract.

Say I load 10*12 contracts into OpenQuant Instruments and the contract calendar spread for each roll.

I need to simulate as part of the strategy rolling the position if it is held during the calendar roll period in OQ2013.

Please advise since each strategy right now is hosted as just on 1 symbol.

My thoughts right now is I can use onBarSlice() for daily data, and then for each individual symbol infer if its that contracts particular month to roll.

Thoughts and advice? I would use OQ2014 but I need to use software that is production ready with zero probability of bugs.

Thanks
Peek

Author:  Baraz Sergey [ Sun Oct 19, 2014 11:05 am ]
Post subject:  Re: Strategy that simulates rolling futures as part of strat

Hi Peek,

I would suggest to do the following:

1) create 3 insruments for each symbol your system trades, for example:
- COFFEE (that always contains data of the "active" ticker)
- COFFEE_New (used by the roll strategy, contains data of the "next" future, to which you need to roll your position)
- COFFEE_Old (used by the roll strategy, contains data of the "current" future, from which you need to roll your position)

2) create 2 strategies:
- your main trading strategy, subscribe COFFEE. Note, that this strategy doesn't know actually that it trades some contract that needs to be rolled.
- roll strategy, subscribe COFFEE_New and COFFEE_Old, put some code that "enables" this strategy when you need to roll your position.

3) create a script that fills all 3 instruments with data correspondingly.

Regards,
Sergey.

Author:  peek [ Mon Oct 20, 2014 9:00 pm ]
Post subject:  Re: Strategy that simulates rolling futures as part of strat

Hi Baraz,

Thanks for the reply.

Does anyone have a sample solution with this?

Thanks,
Peek

Author:  peek [ Mon Oct 20, 2014 10:14 pm ]
Post subject:  Re: Strategy that simulates rolling futures as part of strat

Does that solution work in OpenQuant 2014 or OpenQuant 2013?

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/