From 5ea36a6064249f4bff98a438f38c1fce676f0cda Mon Sep 17 00:00:00 2001 From: kingchenc Date: Sat, 23 May 2026 00:42:14 +0200 Subject: [PATCH] examples(wasm): add a browser backtest demo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The WASM example set had only `index.html` (the streaming canvas demo); the "backtest" cell of the cross-language matrix was empty. Close it. * examples/wasm/backtest.html — loads the wasm-pack `--target web` bundle, fetches an OHLCV CSV from the same `examples/data/` directory the other languages use (default: `btcusdt-1d.csv`), parses it in-page and streams every candle through SMA, EMA, RSI, MACD, Bollinger, ATR, ADX and OBV via the WebAssembly bindings. Renders a summary table with mean / min / max / last per series — mirrors the Rust, Python and Node backtest examples both in indicator set and in output shape. Build the WASM module once (`wasm-pack build bindings/wasm --target web --release --features panic-hook`), then serve the repository root and open `examples/wasm/backtest.html`. The inline module script syntax-checks cleanly under `node --check` on the extracted body. --- examples/wasm/backtest.html | 199 ++++++++++++++++++++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 examples/wasm/backtest.html diff --git a/examples/wasm/backtest.html b/examples/wasm/backtest.html new file mode 100644 index 00000000..851a3586 --- /dev/null +++ b/examples/wasm/backtest.html @@ -0,0 +1,199 @@ + + + + + Wickra WASM — backtest + + + +

Wickra WASM — backtest

+

+ Streams every candle of an OHLCV CSV through a basket of indicators + (SMA, EMA, RSI, MACD, Bollinger, ATR, ADX, OBV) via the WebAssembly + bindings and prints a per-series summary. The browser counterpart of + examples/python/backtest.py, + examples/node/backtest.js and + examples/rust/src/bin/backtest.rs. +

+ +

+ + +

+ +

Loading WASM module…

+ + + + + + + + + + +