quantopian/zipline ? reverse-engineered prompt

Reverse engineered prompt

I want to build a tool for backtesting my stock trading ideas using Python. It should be a library that lets me write a simple script defining my trading strategy and then run it against historical market data to see how it would have performed.

For example, I'd like to be able to write a function that gets called for each day in a simulation. Inside that function, I could check conditions like whether a short-term moving average has crossed a long-term one. Based on that logic, I could use built-in commands from the library to buy or sell a specific stock, like AAPL.

It should also come with a command-line utility to run a backtest on my strategy script over a specific time range, like from 2016 to 2020. The final result of the backtest should be a performance summary that's easy to analyze, preferably in a format compatible with Pandas so I can use other data science tools like matplotlib for visualization.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab