The only time I see this as a potential issue is when you introduce the ability to create calendars.
It is probably our main strategy, or close to it.
But, there are certain things about the way we construct them that is "set in stone" , and is a constant.
For example, if we are putting on a calendar in the period leading up to earnings, the front expiration, which we are selling, will ALWAYS be the 1st expiration after earnings.
Then, there are other variables that are pretty consistent, but do change from time to time depending upon the specific underlying.
Some of those considerations are,.....are there very liquid weeklies?
We will ALWAYS sell the 1st expiration post earnings.
But, beyond that, we may buy the following week (ex. GOOG) or more commonly the first monthly because of the extra liquidity.
You program is really great and on the right track but, as we move along, these are a few examples of things you might need to tweak.