Okay, I lied a little. This isn't quite parameter optimization. It's more of a brute force parameter search.
What I'm about to show you isn't the most efficient, it isn't the most powerful, and it isn't the fastest and most innovative method out there. But it works, it's simple, and it might just make your life a whole lot easier! I've used this a lot to help with my own algorithm writing and development and it's been super helpful while trying to figure out what parameters (weights, symbols, etc.) are best suited for my algorithms.
The notebook has a much more clear description so I highly recommend that you click 'View Notebook' in order to get started but if you want the basic summary, here it is:
Let's say I want an algorithm that only longs AAPL and SPY but I don't know how much to hold in each security. I could try hitting 'build algorithm' 50 times in the IDE but that's tedious and my macbook can't open that many tabs. So what do I do?
The answer is easy: Create that same algorithm in Zipline and spin up 50 algorithm runs. Each run will have different parameters and because I can get the results of each run through Zipline, I can see exactly which parameter led to the best returns or Sharpe ratio.