展示 HN:The0——用于交易机器人的自托管运行时,自带编程语言
Show HN: The0 – self-hosted runtime for trading bots, bring your own language
我们发现了什么
我以自己特定的方式在本地回测机器人,现在借助 AI,我的智能体可以在本地生成代码、回测并分析结果,无需在执行平台上运行其中任何内容。The0 是开源的,采用 Apache-2.0 许可证:https://github.com/alexanderwanyoike/the0。我目前使用 the0 运行自己的个人算法交易机器人
- 来源:Hacker News(发现于 2026-07-21)
- 证据等级:D · 发现产品或需求信号,暂未获得可核验的商业证据。
- 商业模式:API / Usage-based
- 主题:独立产品
- 初筛评分:18.4/100 · 收录 1 次
证据,比故事更重要。
规则清洗与初筛,未经人工商业核验。原文语境、实际客户和付费情况仍需自行验证。
引用与数字披露
来源类型(原作者自述/第三方测算/媒体转引)需采集端标注,本版尚未落字段。
- 作者
- 未标注
- 抓取日期
- 来源类型
- 未标注
- 币种
- 未标注
- 口径
- 未标注
- 披露主体
- 未标注
- 披露日期
- 未标注
中文辅助译文(全文)
我是一名独立开发者,一直对算法交易很感兴趣。最初我通过 Yves Hilpisch 的《Python for Algorithmic Trading》一书学习如何进行算法交易,读完那本书后我就彻底迷上了,于是开始构建算法交易机器人。最初这些是一些独立的 Python 脚本,我在本地机器上运行。这是个糟糕的主意,因为本地机器并不可靠,而我想 365 天 24 小时不间断地运行我的机器人。在我的实际职业生涯中,我是一名软件工程师,有构建分布式系统和容错 Web 应用程序的经验。我对将代码部署到 MetaTrader、CTrader 或 QuantConnect 等托管服务并不感兴趣,因为我想完全掌控我的代码及其运行环境。我还希望能够用任何我想要的编程语言运行我的机器人,而不仅仅是 Python。有时我想用 Python 原型化一个机器人,然后出于性能原因用 C++ 或 Rust 重写它。很多人在这个阶段会说,为什么不使用 Lean、Freqtrade 或 Hummingbot 这样的框架呢?然而我发现这些框架过于固执己见,一旦你决定使用它们,你的机器人就成为它们框架不可分割的一部分。我在本地以自己特有的方式回测我的机器人,现在有了 AI,我的代理可以在本地生成代码、回测并分析结果,无需在执行平台中运行任何东西。我想要的机器人可以像任何其他软件应用一样部署、版本化、更新和监控。我还想探索构建一种以标准化方式运行机器人的东西。这是一段长达 4 年的旅程,沿途我犯了很多错误。该应用程序经历了 4 次架构变更,其中 3 次基本上是完全重写。
第一个版本是一个 Python 程序,机器人只是动态加载的模块。第二个版本是我的无服务器阶段,当时我内部只想要一个由 cron 触发在线的、只为我工作的东西。第三次是我第一次涉足 kubernetes;更加云原生,而我这个傻瓜决定尝试把它做成 SaaS。最终形态是一个完全自托管的运行时、API、CLI 和前端,让你能够以容错方式将机器人作为容器运行,无论是本地(通过 docker the0 local)还是集群中(k8s),并通过一个极简的前端进行监控。为了支持多种语言,机器人必须实现一个简洁的契约:一个 main(bot_id, config) 函数和一个 bot-config.yaml 文件。运行时(用 Go 编写)负责其余工作,它支持 C++、Rust、Python、JS/TS、C#、Scala 以及那些有足够勇气去尝试的 Haskell。更多架构信息请见:https://docs.the0.app/runtime 如果你想试用 the0,可以在本地运行,指南见:https://docs.the0.app/deployment/local-getting-started 。The0 是开源的,遵循 Apache-2.0 许可:https://github.com/alexanderwanyoike/the0 我目前使用 the0 在一个每月 10 美元的 Hetzner VPS 上的单节点 k3s 集群中运行我自己的个人算法交易机器人。我在 2 个经纪商(Alpaca、Bybit)上运行 18 个机器人,它们已经稳定运行了数月而没有任何问题。
一些机器人交易加密货币,另一些交易股票,有些做风险分析,还有些用于投资。最酷的部分是 API 提供了一个 MCP 服务器,所以 AI 代理可以查询机器人的状态、查看它们的日志、监控它们甚至更新它们。装上 OpenClaw 代理,你就可以有效地搭建一个自主的 AI 量化交易系统(祝你好运追逐 Alpha)。现在我必须承认 Lean 拥有所有工具,量化能力也远胜 the0,但我一直觉得它做得太多了。每个 Lean engine 运行一个算法,一旦你有大量机器人,在生产环境中运行和管理它们就全靠你自己。这正是 the0 所做的事情,也是它唯一想做的事情。如果你发现小问题或有功能建议,我洗耳恭听。更多内部细节在我的第一条评论中。
译文由上游机器翻译生成,可能有误;判断请以英文原文为准。
英文原文(来源本站未改写)
So Im a solo developer who has always had an itch for algorithmic trading.Initially I started off learning how to trade algorithmically with Yves Hilpisch book "Python for Algorithmic Trading" after reading that book I was hooked and started building algorithmic trading bots.Initially these were separate python scripts that I ran on my local machine.That was a bad idea cause local machines are not reliable and I wanted to run my bots 24/7 365.In my actual career im a software engineer with experience in building distributed systems and fault tolerant web applications.
I wasn't interested in deploying my code to managed services like MetaTrader, CTrader or QuantConnect etc because I wanted to have full control over my code and the environment it runs in.I also wanted to be able to run my bots in any programming language I wanted, not just Python.Sometimes I wanted to prototype a bot in Python and then rewrite it in C++ or Rust for performance reasons.Many at this point would have said why not use a framework like Lean or Freqtrade or Hummingbot.However I found that these frameworks were too opinionated and if you decide to use them then your bot is now part and parcel of their framework.
I backtested my bots locally in my own specific way, and now with AI my agents can generate code, backtest and analyze the results all locally, no need to run any of it in the execution platform.I wanted bots I could deploy, version, update and monitor like any other software application.I also wanted to explore building something that creates a standardized way of running bots.This has been a 4 year journey and I made a lot of mistakes along the way.The application has seen 4 rearchitectures, 3 of which were basically complete rewrites.The first version was a python program and the bots were just modules that were loaded dynamically.
The second was my serverless phase when I internally just wanted something that was online cron triggered and only works for me.The third was the first time I was dipping into kubernetes;more cloud native and the idiot in me decided to try make it a SaaS.The final form is a fully self-hosted runtime, api, cli and frontend that let you run bots as containers in a fault tolerant way both locally (through docker the0 local) and in a cluster (k8s) and monitor them with a minimalistic frontend.To support multiple languages there's a thin contract that the bots have to implement: a main(bot_id, config) function and a bot-config.yaml file.
The runtime (written in Go) takes care of the rest, it supports C++, Rust, Python, JS/TS, C#, Scala and Haskell for those who are brave enough to try it.More on the architecture here: https://docs.the0.app/runtime If you want to play with the0 you can run it locally, guide here: https://docs.the0.app/deployment/local-getting-started .The0 is open source and licensed under Apache-2.0: https://github.com/alexanderwanyoike/the0 I currently use the0 to run my own personal algorithmic trading bots on a single node k3s cluster on a $10/month Hetzner VPS.I have 18 bots running on 2 brokers (Alpaca, Bybit) and they have been running for months without issues.
Some bots trade crypto, others stocks, some do risk analysis and others invest.Coolest bit is the API provides an MCP server so AI agents can query the state of the bots, look at their logs, monitor them and even update them.Slap an OpenClaw agent and you can effectively setup an autonomous AI quantitative trading system (good luck chasing Alpha).Now I must admit Lean has all the tools and far more quantitative prowess than the0, but I always felt it does too much.Each Lean engine runs one algorithm, and once you have lots of bots, running and managing all of them in production is left to you.That's the part the0 does, and its the only part it tries to do.
If you find hiccups or have ideas for features Im all ears.More on the internals in my first comment.
这条还缺什么证据?
下面每条都由本条已有字段推出(等级、理由、商业模式、来源次数、是否演示), 本站不生成推测性结论;通用验证方法放在方法论页。
- 可核验的收入或付费证据查官网定价页与付费口径;第三方数据源(如 GetLatka)只作旁证,需标注来源与时点。
- 只有单一来源找一手站点或其他渠道是否重复出现同一产品;社区热帖数量不等于商业进展。
通用验证清单(谁有这个问题/谁愿意付费/一个人能交付哪一小步)见我们的筛选方法。