mementum/backtrader ? reverse-engineered prompt
Reverse engineered prompt
Build me a Python library for backtesting and live trading strategies. I want to be able to define my own strategies in code, like creating a simple moving average crossover rule, and then test it against historical market data.
The system should be able to fetch data from online sources like Yahoo Finance, but also let me load data from my own CSV files. It needs a big library of built-in technical indicators, and it would be a huge plus if it could also integrate with TA-Lib for even more options. When running a backtest, it should simulate a broker with different order types and commission costs.
After a test run, I want to see performance metrics like the Sharpe Ratio. Crucially, it must be able to plot the results on a chart, showing the price history with my buy and sell signals on top. Finally, I'd like the option to connect it to a live broker account, like Interactive Brokers, to run my strategies in real-time.
Are you gonna build this?
make sure you review the code using coderabbit