Andreas Clenow has some great examples of Python usage (using Zipline) in his latest book, and he has put the source code up for all to use too:
https://www.dropbox.com/s/tj85sufbsi820ya/Trading Evolved.zip
My data provider (Norgte) has adapted this code to use their data (Zipline is a bit tricky to get data into otherwise) and will provide it on request.
I can't tell you whether it's exemplary, but it certainly answers questions of "how would I program up a mean reversion system in Python/Zipline?"
I wonder what the Dutch got to do with Python.There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.

I wonder what the Dutch got to do with Python.![]()
I wonder what the Dutch got to do with Python.![]()
Zipline code is terrible imo
Andreas Clenow has some great examples of Python usage (using Zipline) in his latest book, and he has put the source code up for all to use too:
https://www.dropbox.com/s/tj85sufbsi820ya/Trading Evolved.zip
My data provider (Norgte) has adapted this code to use their data (Zipline is a bit tricky to get data into otherwise) and will provide it on request.
I can't tell you whether it's exemplary, but it certainly answers questions of "how would I program up a mean reversion system in Python/Zipline?"
Actually, I wouldn't even hold my own code up as exemplary https://github.com/robcarver17/pysystemtrade if you want to see another example of how not to do it.