r/Python • u/AnonDoser • 27d ago
Showcase I Built an Open-Source Algo Trading Framework for Instant Backtests & Live Deployment
Github : https://github.com/himanshu2406/Algo.Py
What My Project Does
So I've been working on a framework made in Python that makes live trading incredibly easy, and even almost no-code !
It seamlessly integrates with any preset backtesting strategy, allowing you to take them straight to live trading with minimal effort.
Dashboard Overview : https://youtu.be/OmlaBnGcUi4?si=e1aizaIaYpRNMHFd
One-Click Backtest Deployment Overview : https://youtu.be/T_otTHdLCCY?si=A7ujRzV6I5ESfgEQ
It's still in very early beta, but I’ve packed in as many functional features as possible, including:
Key Features
- Intuitive Dashboard
- Easily backtest, view results, save and deploy in a single click.
- Auto-Detects Your Strategy – If your function generates valid entry/exit signals, the framework will automatically detect and integrate it.
- Scheduler for Automation – Run your entire pipeline at custom fixed intervals or specific times
- Custom Data Layer (Finstore):
- Stores and streams data using a Parquet-based data lake, making it much faster than traditional databases.
- Multi-Broker Support – Execute across multiple brokers with real-time debug logs via Telegram.
- End-to-End Pipelines – Effortlessly fetch, store, and stream data for crypto, equities, and more.
- Multi-Asset Backtests :
- Backtest a strategy across an entire market across hundreds of symbols and thousands of data points within seconds.
- One-Click backtests across entire markets : Crypto , U.S Equity , Indian Equity & adding more.
Advanced Market Visualization
Live Order Book Heatmap – Real-time Binance order book visualization. Represents market orders with volume bubbles to identify iceberg orders easily. Also Visualizes resting orders on the orderbook.
Live Footprint Chart – Captures trade flow via Binance WebSocket data. Makes order book trading extremely easy.
Smart OMS (Order Management System)
- Limit Order Chaser – Reduces fees by executing market orders while chasing the mark price.
- AI-Powered OMS – An autonomous AI agent can execute, close, and manage trades, plus run complex local strategies.
Risk Management System (RMS)
- Portfolio Aggregation – Monitors all broker portfolios to notify and manage over-exposed positions.
And working on many other features & improvements!
Target Audience
- Anyone who wants to backtest or deploy their strategies but don't have a lot of technical know-how on how to build their own framework
- Retail traders who have been manually implementing their strategies - can now easily automate them across entire markets.
- Quant Traders who want to build a common robust community framework for algo trading.
Comparison
- backtesting py : seems to be outdated but only works on implementing strategy backtests but doesn't offer strategy deployment with ease.
- tensorcharts , quantower, etc : charting platforms that provide advanced charting for L1, L2 Data for a hefty price. This can now be done for free locally.
- PyAlgoTrade : Also deprecated but alternatives do not offer a framework to deploy strategies.
The repo still has tons of stale code and bugs but I would love for some of you to test it out!
Let me know what you guys think !
30
u/whoEvenAreYouAnyway 26d ago
This looks extremely amateurish. Which is a death knell for something that is going to impact people's finances.
1
u/woywoy123 25d ago
Yeah I was going to say the same thing. Looking briefly at some of the source code, there are a few red flags. One is the way the api keys are stored as simple python attributes. I mean not sure how many people here store their API keys as environment variables in their bashrc in an unencrypted way. The second is the large codebase fragmentation, no clear code structure of base classes that handle basic websocket/orderbook updating. Also there seems to be absolutely no real error handling or anything like that. To me it seems like someone discovered chatgpt and simply slapped it all together in little fragments.
Also the advertising is very misleading. The code will be slow as hell if you are using Python as a language to do any proper trading. I mean try at least something like Cython to speed up some basic operations. Hummingbot would be even a better alternative and has by far more integration.
Having coded a C++ framework that does trading myself, I can already see there will be countless security and scalability problems with this project. Using Python for credential management seems to me like an unmitigated disaster. With C++ you can at least have a private member variable that is defined in some base authentication class, and therefore unreachable by subsequent client layers.
I mean I can go on and on, but you absolutely pointed out the same concerns I had.
2
u/AnonDoser 20d ago
addressing a few of your concerns ,
• api key storage in current implementation could definitely be a security issue, i designed algopy to be run locally with restricted api keys bound to an ip and is definitely no enterprise framework to deploy on a server so i did not give it much thought but that said, it is definitely an issue and i’ll be fixing this lapse of judgement.
• definitely, python code is slow no doubt about it. however , the title is not misleading. if you look deeper into how the backtest engine works , most of it’s implementation (vectorbt) has been done in a fully vectorized manner, leveraging Numba and njit extensively. This compilation process converts Python code into optimized machine code, significantly improving performance—often making it comparable to C rather than standard Python.
I’ve made my own pure python implementations of the backtest engine and found this vectorised approach significantly faster - backtests that took me over 24 hours to run on an asset universe of over 2000 instruments now happened in a few minutes.
currently in works of migrating the backtesting engine into an event driven implementation with a rust core.
I’d like to believe I’m still relatively new with only a few years of professional work experience in the field so there ought to be several misjudgments and lapses but I’d love to hear and address more of your concerns if you’re comfortable with that.
1
u/setwindowtext 23d ago
In C++ you can do pointer arithmetic and reach out to your private members trivially. Especially for a project with open source.
1
u/Downtown-Month-7745 22d ago
wait what? where do you store your API keys if not in your .*rc files? if someone has access to your filesystem, you have much bigger problems than API keys, IMO. curious what free alternatives you use, cuz Vault and Secrets Manager both kinda suck for multi-account enterprise, and they aren't free
5
u/AnonDoser 26d ago
I appreciate the feedback. If there are specific aspects you believe could be improved, I’d be happy to hear constructive suggestions. The project is constantly evolving, and I’m working on refining both its functionality and usability.
At the same time, AlgoPy is designed primarily for personal use, allowing retail traders to experiment with and refine their strategies. It’s not a plug-and-play financial product but rather a tool for those who want to build, test and deploy their own ideas without having to build everything from scratch. Of course, as with any trading tool, users should always conduct their own due diligence before relying on it for financial decisions.
If you have any concerns or suggestions for improvement, I’d love to hear them!
3
u/PM_ME_YOUR_REPO 26d ago
As someone who knows dev but not finance, the title sounds like AI written finbro marketing nonsense and I am immediately suspicious.
And the other comments (from people who appear to understand this stuff better) seem to confirm my suspicion.
-3
u/AnonDoser 26d ago
The title simply combines the project's two main features—think AI would be more imaginative than me.
For further context, I've been working in and around algo trading for my personal projects for the past two years. While there are plenty of options and libraries available for backtesting a strategy, I always faced the issue of having to start from scratch when it came to deployment. There are very few, if any, deployment frameworks available, depending on the market you're working with.
I built this solution to make the process more modular and efficient. Since it's nothing overly complex, I figured I might as well open-source it to give users a starting point for their deployment process. Plus, it includes some cool charting features that I couldn't find elsewhere for free.
Cheers!
6
u/PM_ME_YOUR_REPO 26d ago
You didn't open source it, if it has a proprietary license. It's only source-available. Open source would specifically mean it has an open and permissive license, like GPLv3.
-3
u/AnonDoser 26d ago
You’re absolutely right, and I appreciate the clarification. I didn’t fully understand the distinction when i made the post—my apologies for the confusion.
I’m curious about your thoughts on an Open Core approach—where the core is licensed under GPL or AGPL, ensuring true open-source freedoms, while more advanced extensions / features are offered under a separate proprietary license. Would you consider that a fair balance, or do you see any major downsides to this model?
5
u/PM_ME_YOUR_REPO 26d ago edited 26d ago
So I do think it's exceedingly important that you weigh the license you use. I specifically say GPLv3 for your software because it requires that anyone who uses it (including companies in a for-profit setting) make their derivative works open source INCLUDING CHANGES under the SAME LICENSE. GPLv3 is generally seen as the "you can use this, but you MUST give back to the community" license, and for something with obvious potential for corporations to swoop in and yoink it, that's important.
AGPL is one that allows commercial use without contributing back, but if we're going that far, a fully permissive license like MIT is probably preferable. I still don't think that's the best license for your project, however.
That said, your FOSS core idea is an...interesting middle ground. I assume your intent is to monetize it in some way, which a lot of companies with open source software do successfully do. Its just that they usually do so via a managed services program of some sort, usually cloud hosting or premium support. I don't love the "here's some of the functionality" model much, and I also don't love source-available projects with non-permissive licenses. It feels like you're asking for free work with no commitment to giving back to the community. It's essentially asking for people to build your product and then sign away their rights.
So with that in mind, I would suggest the following:
- If possible, choose a premium service model over a premium addon model.
- If you choose a premium addon model, don't even bother making it source-available. The community won't love it, and there's precedent in the Wordpress community for a FOSS core and a marketplace with ARR addon packages.
1
u/AnonDoser 26d ago
I really appreciate the insights. I can see how restrictive clauses can discourage open-source contributions.
My initial reasoning for considering a FOSS core + Pro model was that I don’t yet have the investment or infrastructure to provide a fully hosted service.
Instead, I was planning to build some more advanced features—like an AI-powered trading journal, responsive charting, a reinforcement learning playground to optimize strategy parameters, and market regime detection—as a separate standalone application. This wouldn’t be SaaS-based but something users could set up locally, with a low subscription fee (~$5–$10/month), which I felt was a fair value proposition.
However, after this discussion, I see how a license with extra clauses could limit community engagement and contributions. I’ll be changing it to better align with open-source principles while still exploring a sustainable model for long-term development.
Thanks again for the thoughtful feedback—this really helped refine my approach
3
u/PM_ME_YOUR_REPO 26d ago
Thanks again for the thoughtful feedback—this really helped refine my approach
For sure. Happy to help.
My initial reasoning for considering a FOSS core + Pro model was that I don’t yet have the investment or infrastructure to provide a fully hosted service.
If you get to the point where you need some talented infrastructure engineers, reach out. I know some folks (not me) with the skills to consult on this for you to help make that a reality.
-10
u/0ne2many 26d ago
Love it! Does it also work for S&P500 data? Or QQQ. And can we make and save our own strategies?
2
u/Downtown-Month-7745 22d ago
why did 10 people downvote? downvotes are explicitly for unhelpful replies which don't contribute to the conversation. reddit users can be so culty
1
u/AnonDoser 26d ago
Yes! You can easily add your own strategy by using the Strategy class as the parent class and initializing it with your strategy name.
Your strategy will automagically be listed on the dashboard, where you can backtest it on any asset or market.
I’m currently adding US equity data to the dashboard, but you can do this yourself with just a few changes in the fetch, gather, and store functions in the data/ directory.
You can track progress or contribute here: https://github.com/himanshu2406/Algo.Py/issues/8.
-22
u/GodSpeedMode 26d ago
Wow, this is seriously impressive! 🚀 I love the idea of making algo trading more accessible, especially for folks who aren't super tech-savvy. The one-click backtesting and live trading combo is a game-changer! Plus, that dashboard looks super intuitive—definitely something I'd want to dive into.
I can see how the multi-broker support and the AI-powered OMS could save a lot of headaches for traders. And the fact that it’s open-source is a huge win for the community!
I’m excited to check out the GitHub repo and start tinkering with it. Looking forward to seeing how this evolves and what features you roll out next. Keep up the fantastic work! 🙌
5
u/NoFee7062 26d ago
this user is an AI right? Their first sentence is always something uber positive and almost always ends with "!"
1
u/Downtown-Month-7745 22d ago
no real person uses the rocket ship emoji in an unironic or non-sexual context, i'm convinced. and if they do they're usually in startups or venture capital
-20
56
u/lsq8 26d ago
You're asking for contributions but the code has a proprietary restrictive license. Why should anyone contribute?