wickra-backtest-wasm 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
  <a href="https://wickra.org"><img src="https://raw.githubusercontent.com/wickra-lib/.github/main/profile/wickra-banner.webp?v=514-7" alt="Wickra Backtest — backtest and live are byte-identical" width="100%"></a>
3
3
  </p>
4
4
 
5
- [![Built on Wickra](https://img.shields.io/badge/built%20on-wickra-3b82f6)](https://github.com/wickra-lib/wickra)
6
- [![Status](https://img.shields.io/badge/status-pre--release-orange)](https://github.com/wickra-lib/wickra-backtest)
5
+ [![Built on Wickra](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-backtest/built-on.svg)](https://github.com/wickra-lib/wickra)
6
+ [![Status](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-backtest/status.svg)](https://github.com/wickra-lib/wickra-backtest)
7
7
  [![CI](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-backtest/ci.svg)](https://github.com/wickra-lib/wickra-backtest/actions/workflows/ci.yml)
8
8
  [![CodeQL](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-backtest/codeql.svg)](https://github.com/wickra-lib/wickra-backtest/actions/workflows/codeql.yml)
9
9
  [![codecov](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-backtest/codecov.svg)](https://codecov.io/gh/wickra-lib/wickra-backtest)
@@ -21,7 +21,7 @@
21
21
  [![Build provenance](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-backtest/provenance.svg)](https://github.com/wickra-lib/wickra-backtest/attestations)
22
22
  [![Docs](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-backtest/docs.svg)](https://backtest.wickra.org)
23
23
  [![Verified across 10 languages](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-backtest/verified.svg)](golden/)
24
- [![Live demo](https://img.shields.io/badge/live%20demo-backtest--live.wickra.org-3b82f6)](https://backtest-live.wickra.org)
24
+ [![Live demo](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-backtest/live-demo.svg)](https://backtest-live.wickra.org)
25
25
 
26
26
  ---
27
27
 
@@ -82,7 +82,7 @@ The two reports are byte-identical. That is the whole claim, and a shared
82
82
 
83
83
  ## Status
84
84
 
85
- **0.1.7 — the current release.** The engine, the data-driven `StrategySpec`, the
85
+ **0.1.8 — the current release.** The engine, the data-driven `StrategySpec`, the
86
86
  full execution and cost model, the microstructure feeds and all ten language
87
87
  bindings are implemented and tested; a shared [golden corpus](golden/) pins the
88
88
  cross-language equality byte-for-byte.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "kingchenc <support@wickra.org>"
6
6
  ],
7
7
  "description": "WebAssembly bindings for the wickra-backtest streaming backtester — backtest in the browser.",
8
- "version": "0.1.7",
8
+ "version": "0.1.8",
9
9
  "license": "MIT OR Apache-2.0",
10
10
  "repository": {
11
11
  "type": "git",
@@ -41,11 +41,6 @@ export class StreamingBacktest {
41
41
  * Build from a JSON strategy spec and starting capital.
42
42
  */
43
43
  constructor(spec_json: string, capital: number);
44
- /**
45
- * Advance by one OHLCV bar. `volume` defaults to 0 and `time` to the number
46
- * of bars fed so far.
47
- */
48
- step(open: number, high: number, low: number, close: number, volume?: number | null, time?: number | null): void;
49
44
  /**
50
45
  * Advance by one bar described as a request document:
51
46
  * `{"candle": {...}, "feeds": {...}}`, where `feeds` optionally carries this
@@ -53,6 +48,11 @@ export class StreamingBacktest {
53
48
  * This is the only form that can drive a strategy reading a side feed.
54
49
  */
55
50
  stepJson(step_json: string): void;
51
+ /**
52
+ * Advance by one OHLCV bar. `volume` defaults to 0 and `time` to the number
53
+ * of bars fed so far.
54
+ */
55
+ step(open: number, high: number, low: number, close: number, volume?: number | null, time?: number | null): void;
56
56
  /**
57
57
  * Whether the run has been finished or closed.
58
58
  */
@@ -168,19 +168,18 @@ export class StreamingBacktest {
168
168
  }
169
169
  }
170
170
  /**
171
- * Advance by one OHLCV bar. `volume` defaults to 0 and `time` to the number
172
- * of bars fed so far.
173
- * @param {number} open
174
- * @param {number} high
175
- * @param {number} low
176
- * @param {number} close
177
- * @param {number | null} [volume]
178
- * @param {number | null} [time]
171
+ * Advance by one bar described as a request document:
172
+ * `{"candle": {...}, "feeds": {...}}`, where `feeds` optionally carries this
173
+ * bar's `reference` / `deriv` / `orderbook` / `trades` / `cross_section`.
174
+ * This is the only form that can drive a strategy reading a side feed.
175
+ * @param {string} step_json
179
176
  */
180
- step(open, high, low, close, volume, time) {
177
+ stepJson(step_json) {
181
178
  try {
182
179
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
183
- wasm.streamingbacktest_step(retptr, this.__wbg_ptr, open, high, low, close, !isLikeNone(volume), isLikeNone(volume) ? 0 : volume, !isLikeNone(time), isLikeNone(time) ? 0 : time);
180
+ const ptr0 = passStringToWasm0(step_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
181
+ const len0 = WASM_VECTOR_LEN;
182
+ wasm.streamingbacktest_stepJson(retptr, this.__wbg_ptr, ptr0, len0);
184
183
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
185
184
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
186
185
  if (r1) {
@@ -191,18 +190,19 @@ export class StreamingBacktest {
191
190
  }
192
191
  }
193
192
  /**
194
- * Advance by one bar described as a request document:
195
- * `{"candle": {...}, "feeds": {...}}`, where `feeds` optionally carries this
196
- * bar's `reference` / `deriv` / `orderbook` / `trades` / `cross_section`.
197
- * This is the only form that can drive a strategy reading a side feed.
198
- * @param {string} step_json
193
+ * Advance by one OHLCV bar. `volume` defaults to 0 and `time` to the number
194
+ * of bars fed so far.
195
+ * @param {number} open
196
+ * @param {number} high
197
+ * @param {number} low
198
+ * @param {number} close
199
+ * @param {number | null} [volume]
200
+ * @param {number | null} [time]
199
201
  */
200
- stepJson(step_json) {
202
+ step(open, high, low, close, volume, time) {
201
203
  try {
202
204
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
203
- const ptr0 = passStringToWasm0(step_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
204
- const len0 = WASM_VECTOR_LEN;
205
- wasm.streamingbacktest_stepJson(retptr, this.__wbg_ptr, ptr0, len0);
205
+ wasm.streamingbacktest_step(retptr, this.__wbg_ptr, open, high, low, close, !isLikeNone(volume), isLikeNone(volume) ? 0 : volume, !isLikeNone(time), isLikeNone(time) ? 0 : time);
206
206
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
207
207
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
208
208
  if (r1) {
@@ -319,11 +319,11 @@ export function version() {
319
319
  wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
320
320
  }
321
321
  }
322
- export function __wbg_Error_92b29b0548f8b746(arg0, arg1) {
322
+ export function __wbg_Error_67e7344beaa85059(arg0, arg1) {
323
323
  const ret = Error(getStringFromWasm0(arg0, arg1));
324
324
  return addHeapObject(ret);
325
325
  }
326
- export function __wbg___wbindgen_throw_344f42d3211c4765(arg0, arg1) {
326
+ export function __wbg___wbindgen_throw_5d9e815e6fdf150f(arg0, arg1) {
327
327
  throw new Error(getStringFromWasm0(arg0, arg1));
328
328
  }
329
329
  const StreamingBacktestFinalization = (typeof FinalizationRegistry === 'undefined')
Binary file