Total Football Advisors has a powerful approach for adding multiple teams stacks.
Under Set Pro Options you can set a team stack bonus.
The higher you set the bonus, the more the optimizer will use team stacking in your lineups when generating multiple lineups. It is soft constraint and is more flexible than a rigid 3/2 team stack.
To see the effect of the team stacking bonus, you can generate multiple lineups without loading the player list for FanDuel or DraftKings. When you do this, the output CSV will give the list of players and teams rather than the player IDs for FanDuel or DraftKings.
You can try various settings of the team stacking bonus until you find a setting you like best.
Here are the results with the setting at 0%, 10% and 20% respectively, generating ten lineups for a DraftKings main slate, and with all other options set at default values (no diversity, max or min exposure):
Auto Team Stack Bonus = 0%
Note, the total fantasy points of all ten lineups is 1106.15, or the average fantasy points of each lineup is 110.6.
Better teams tend to stack a little bit naturally.
Auto Team Stack Bonus = 10%
With the team stacking bonus set to 10%, you can see the average fantasy points per lineup dropped from 110.6 to 107.7, or 2.6%, but there is significantly more stacking in the lineups as shown below:
Auto Team Stack Bonus = 20%
The trend for a lower average fantasy point per lineup and greater stacking continues.
We believe this soft constraint approach gives a better balance between an average fantasy points per line and the amount of stacking compared with rigid team stack strategies provided with traditional optimizers, and that this results in a higher probability of winning money in contests.