Show HN: PyBroker – Algotrading in Python with Machine Learning
Hello, I am excited to share PyBroker with you, a free and open-source Python framework that I developed for creating algorithmic trading strategies, including those that utilize machine learning. With PyBroker, you can easily develop and fine-tune trading rules, build powerful ML models, and gain valuable insights into your strategy&#x27;s performance.<p>Some of the key features of PyBroker include:<p>- A super-fast backtesting engine built using NumPy and accelerated with Numba.<p>- The ability to create and execute trading rules and models across multiple instruments with ease.<p>- Access to historical data from Alpaca and Yahoo Finance.<p>- The option to train and backtest models using Walkforward Analysis, which simulates how the strategy would perform during actual trading. The basic concept behind Walkforward Analysis is that it splits your historical data into multiple time windows and then &quot;walks forward&quot; in time in the same way that the strategy would be executed and retrained on new data in the real world. Walkforward Analysis also helps overcome the problem of data mining and overfitting by testing your strategy on out-of-sample data.<p>- More reliable trading metrics that use randomized bootstrapping to provide more accurate results. PyBroker calculates metrics such as Sharpe, Profit Factor, and max drawdown using bootstrapping, which randomly samples your strategy&#x27;s returns to simulate thousands of alternate scenarios that could have happened. This allows you to test for statistical significance and have more confidence in the effectiveness of your strategy.<p>- Support for strategies that use ranking and flexible position sizing.<p>- Caching of downloaded data, indicators, and models to speed up your development process.<p>- Parallelized computations that enable faster performance.<p>- Additionally, I have written tutorials on the framework and some general algorithmic trading concepts that can be found on <a href="https:&#x2F;&#x2F;www.pybroker.com" rel="nofollow">https:&#x2F;&#x2F;www.pybroker.com</a>. All of the code is available on Github using the link above.<p>Thanks for reading!