Skip to content

wickra-lib/wickra-playground

Wickra Playground — one strategy spec, run byte-identical in Rust, JS, Go and Python, live in your browser

Built on Wickra CI CodeQL Built with Vue 3 + Vite Zero backend Byte-identical across 4 languages License: MIT OR Apache-2.0 Docs


Wickra Playground

Run one strategy spec live, side by side, byte-identical in Rust · JS · Go · Python — 100% in your browser, zero backend.

Part of the Wickra ecosystem. A web app built on the same deterministic backtest engine (wickra-backtest) that powers the rest of the stack.

Every other TA/backtest library claims cross-language consistency. The playground proves it, live: you write one StrategySpec, and the app runs it through the same Rust core compiled along four independent paths — Rust→WASM, JS-over-WASM, Go-over-WASM, and Python-over-Pyodide — then shows the four BacktestReports in a diff view. When they are byte-identical, the diff reads 0 differences. Any drift in any panel is a bug you can see.

It is a static site: no server, no API key, nothing to host but files. The market data is fetched client-side (a Binance public stream or a bundled CSV), and every computation happens in your browser.

How it works

  1. You edit a StrategySpec (indicators, entry/exit rules, sizing, costs) and pick a candle dataset.
  2. The app hands the same spec and the same candles to each language panel.
  3. Each panel runs the core's run_json(candles, spec) over its own binding path and returns the canonical report JSON verbatim.
  4. The diff view hashes and compares the reports. Identical bytes → "0 differences"; the cross-language claim, proven in front of you.

Determinism is the product

The whole point is byte-identity. The core is deterministic (no RNG, no per-language float reformatting), every binding forwards the core's run_json string unchanged, and the diff view compares the raw bytes — so a green run is a live proof, not a marketing line.

Quickstart

npm install
npm run dev      # local dev server
npm run build    # static build into dist/
npm run test     # the determinism + diff unit tests

Note: the app depends on wickra-backtest-wasm, which is not yet on npm (its release is gated). Until it publishes, npm install cannot resolve the lockfile.

Presets

Four ready-to-run StrategySpec presets ship in the editor, each with a bundled deterministic dataset:

  • SMA crossover — fast/slow simple-moving-average cross.
  • RSI reversion — buy oversold, sell into strength.
  • MACD trend — MACD line crossing the zero level.
  • ATR breakout — a Keltner-style breakout above an ATR band.

Pick one from the dropdown, edit the JSON, and every panel re-runs live.

Use your own data

The data source has three modes:

  • Preset — the bundled CSV for the selected preset (fully static).
  • Upload — drop in your own ts,open,high,low,close,volume CSV.
  • Binance — fetch recent klines for any symbol/interval directly from the Binance public API (keyless; falls back to the data-api.binance.vision mirror, then to the last-loaded dataset).

Whatever the source, all panels receive the exact same candles — that single source is what makes the byte-diff meaningful.

Fork as template

This repo is a GitHub template: click Use this template to spin up your own byte-identity playground against a fork of the engine, or as a starting point for any WASM-core-in-the-browser proof. The spec in the URL (#spec=<base64>) makes every run a shareable, forkable link.

Project layout

src/
  main.ts              app entry
  App.vue              the shell: spec editor + data source + panel grid + diff
  spec/schema.ts       the StrategySpec type + presets
  runner/              one runner per language path (rust, js, go, python) + registry
  lib/                 wasm loader, candle loader, Binance client, hash, diff
  components/          SpecEditor, DataSource, LangPanel, PanelGrid, DiffView, AboutCore
public/data/           bundled deterministic candle CSVs

Contributing

See CONTRIBUTING.md and the Code of Conduct.

Security

Report vulnerabilities per SECURITY.md.

License

Dual-licensed under either MIT or Apache-2.0, at your option.

Disclaimer

wickra-playground is research and engineering tooling, not financial advice. A byte-identical report attests only that the four language paths compute the same deterministic result from the same spec and data — it makes no claim about the quality, profitability or future performance of any strategy. Trading carries risk; you are responsible for your own decisions. Everything runs in your own browser: no hosted service, no data collection, no warranty.

About

A polyglot strategy playground: run one StrategySpec live, side by side, byte-identical in Python, Rust, JS and Go — entirely in the browser (WASM), no backend.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors