Skip to content
AlgoBeam

AlgoBeamTS 1.0: strategy script, anywhere JavaScript runs

Our open-source transpiler hits 1.0. The same AlgoBeamScript strategy now produces identical output in the browser, in Node and on a hosted worker.

EngineeringDev RanganathanPrincipal Engineer, AI7 min read
All posts

Strategy languages have historically been prisons with a nice view. You write your logic inside a vendor’s sandbox, it runs beautifully on their charts, and the moment you want it somewhere else — a research notebook, a paper-trading loop, a service you own — you rewrite it and spend the next six months reconciling two implementations that disagree in small, expensive ways.

AlgoBeamTS exists to remove that rewrite. It is an MIT-licensed transpiler and runtime that turns AlgoBeamScript into plain, readable TypeScript with no proprietary runtime dependency. The output is code you can read in a pull request, step through in a debugger and deploy anywhere a JavaScript engine exists. Version 1.0 freezes the language surface and commits us to semantic versioning from here.

The hard part was never syntax; it was series semantics. AlgoBeamScript is implicitly vectorised — every expression is a series indexed by bar — and getting that to behave identically under a streaming live loop and a batch historical run took most of the project’s life. The runtime now maintains an explicit bar clock, and every stateful builtin declares its warm-up requirement, so a strategy resumed mid-stream produces exactly what a full replay would produce at that bar.

We prove that rather than assert it. The test suite runs every strategy in the standard library twice — batch and streaming — and fails the build on any divergence beyond floating-point tolerance at any bar. The CLI ships the same check for your own code: `algobeam-ts verify` runs your strategy both ways and prints a diff at the first bar where they disagree. It has caught more real bugs in our own indicators than any other tool we own.

One-point-oh also adds a proper plugin interface for data sources. The runtime knows nothing about where bars come from; it consumes an async iterable of typed candles. Adapters exist for our platform feed, for CSV files and for a couple of common broker APIs, and writing another is roughly forty lines. Strategies you write against the interface do not change when the source does.

What is deliberately not in the box: order routing. AlgoBeamTS emits structured signals and stops there. Keeping execution out of the runtime keeps your credentials with you, keeps our outages away from your positions, and keeps the licensing simple — the strategies you write are yours, unencumbered, and we claim no interest in them whatsoever.

Share this piece

Dev Ranganathan

Principal Engineer, AI

Writes for AlgoBeam on engineering. Every figure quoted above can be reproduced in the backtester with the same settings.

Ready when you are

Test it before you trust it.

Take the ideas from this piece into the backtester and run them against a decade of bars with realistic costs. AlgoBeam is free to start and never asks for a card.

  • No card required
  • Cancel anytime
  • 14-day Ultimate trial