diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 551a056d..d4b98278 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,6 +55,63 @@ jobs: # streaming. run: cargo build -p wickra-examples --bins + # Syntax/parse smoke for the non-Rust examples. The Rust examples are built + # in the `rust` job above (`cargo build -p wickra-examples --bins`); the Node, + # browser-WASM and Python examples otherwise have no build gate, so a broken + # edit could land unnoticed. This is a parse-only smoke — actually running the + # examples needs the built native binding / wasm module / wheel, which the + # binding jobs provide separately. + examples-smoke: + name: Examples (syntax smoke) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: "20" + + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + with: + python-version: "3.12" + + - name: Node examples — syntax check + run: | + shopt -s nullglob + count=0 + for f in examples/node/*.js examples/wasm/*.js; do + echo "node --check $f" + node --check "$f" + count=$((count + 1)) + done + echo "checked $count Node/WASM .js files" + + - name: WASM demo module scripts — syntax check + # The .html demos embed an ES module; extract it and parse-check so a + # broken edit to the in-page strategy logic fails CI. + run: | + shopt -s nullglob + count=0 + for f in examples/wasm/*.html; do + node -e 'const fs=require("fs");const h=fs.readFileSync(process.argv[1],"utf8");const m=h.match(/ + + diff --git a/examples/wasm/strategy_macd_adx.html b/examples/wasm/strategy_macd_adx.html new file mode 100644 index 00000000..6abe5d23 --- /dev/null +++ b/examples/wasm/strategy_macd_adx.html @@ -0,0 +1,203 @@ + + + + + Wickra WASM — MACD + ADX trend filter + + + +

Wickra WASM — MACD + ADX trend filter

+

+ Long-only trend follower: enters on a MACD(12,26,9) histogram crossover up + while ADX(14) > 20, exits on the opposite crossover, 0.1% fees. The + browser counterpart of examples/python/strategy_macd_adx.py, + examples/node/strategy_macd_adx.js and the Rust + strategy_macd_adx.rs — same loop, same summary. +

+ +

+ + +

+ +

Loading WASM module…

+ + + + + + + + + + + diff --git a/examples/wasm/strategy_rsi_mean_reversion.html b/examples/wasm/strategy_rsi_mean_reversion.html new file mode 100644 index 00000000..305d3e33 --- /dev/null +++ b/examples/wasm/strategy_rsi_mean_reversion.html @@ -0,0 +1,202 @@ + + + + + Wickra WASM — RSI mean-reversion + + + +

Wickra WASM — RSI mean-reversion

+

+ Goes long when RSI(14) crosses below 30 and exits above 70, with 0.1% fees + and a full-in / full-out position. The browser counterpart of + examples/python/strategy_rsi_mean_reversion.py, + examples/node/strategy_rsi_mean_reversion.js and the Rust + strategy_rsi_mean_reversion.rs — same signal → fill → PnL → + equity loop, same summary. +

+ +

+ + +

+ +

Loading WASM module…

+ + + + + + + + + + +