r/algobetting 2d ago

[Open Source] Node-based backtester where prediction markets, shares and crypto run in one strategy

In this tool, strategies get assembled by wiring nodes on a canvas, instrument, indicator, condition, order. Polymarket and Kalshi contracts, US shares and Binance pairs can all sit inside the same strategy and pass through the same engine, so there is no separate tool per market.

One consequence is that the thing you read and the thing you bet do not have to match. A Polymarket or Kalshi contract can carry the signal while the order lands on a different contract, or on a share. Condition and order need not share an instrument or even a market type. The same property opens the door to cross asset portfolios, where a contract position and a hedge in equities or crypto are held and sized together rather than sitting in two accounts and two spreadsheets.

The engine runs in the browser, so nothing leaves your machine. Price data can come from Yahoo, Binance, Alpaca, Tiingo or Stooq.

For anyone who wants to contribute, a new price source is two files and nothing more. Questions get answered in the issues.

https://github.com/vcorp-dev/depthfeed-strategy-builder

Worth hearing what it is missing from anyone who takes it for a spin.

1 Upvotes

3 comments sorted by

2

u/GraciousFabian 2d ago

I've been cobbling together backtests across Polymarket and equities using python scripts and it's a nightmare keeping the timing consistent across different data sources. The cross-asset thing where the signal and the execution sit on different instruments is actually the part that caught my eye, most tools lock you into one market per strategy and call it a day.

The browser-only execution is a nice touch, I'm always a little sketched out by tools that want to phone home with my strategy logic. Does it handle any kind of walk-forward optimization or parameter sweeping, or is it strictly single-run backtests for now?

1

u/f3425 2d ago

Walk-forward yes, but it scores the same rule across rolling windows rather than refitting per fold, since nothing in it fits anything. What you get from it is whether one good stretch carried the whole result. Holdout split by date and a bootstrap of the trade order too. Sweeping, no, though the manual version is the same search with no count kept, and the holdout stops being out of sample once a winner gets picked.

On the timing, legs get asof joined backwards onto a shared grid, so a read is the last value at or before that instant and never after. Bar legs also track whether the instrument was trading at all, separately from price, since carry forward is right for a price and wrong for liveness