wickra-wasm 0.7.4 → 0.7.6
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 +47 -25
- package/package.json +1 -1
- package/wickra_wasm_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -2,24 +2,26 @@
|
|
|
2
2
|
<a href="https://wickra.org"><img src="https://raw.githubusercontent.com/wickra-lib/.github/main/profile/wickra-banner.webp?v=514" alt="Wickra — streaming-first technical indicators" width="100%"></a>
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
[](https://github.com/wickra-lib/wickra/actions/workflows/ci.yml)
|
|
6
|
+
[](https://github.com/wickra-lib/wickra/actions/workflows/codeql.yml)
|
|
7
|
+
[](https://codecov.io/gh/wickra-lib/wickra)
|
|
8
|
+
[](https://github.com/wickra-lib/wickra/releases/latest)
|
|
9
|
+
[](https://crates.io/crates/wickra)
|
|
10
|
+
[](https://pypi.org/project/wickra/)
|
|
11
|
+
[](https://www.npmjs.com/package/wickra)
|
|
12
|
+
[](https://www.nuget.org/packages/Wickra)
|
|
13
|
+
[](#license)
|
|
14
|
+
[](https://scorecard.dev/viewer/?uri=github.com/wickra-lib/wickra)
|
|
15
|
+
[](https://www.bestpractices.dev/projects/13094)
|
|
16
|
+
[](https://github.com/wickra-lib/wickra/attestations)
|
|
17
|
+
[](https://docs.wickra.org)
|
|
17
18
|
|
|
18
19
|
**Streaming-first technical indicators. Install with `pip install wickra` — no system dependencies.**
|
|
19
20
|
|
|
20
21
|
Wickra is a multi-language technical-analysis library with a Rust core and
|
|
21
|
-
bindings for Python, Node.js
|
|
22
|
-
|
|
22
|
+
native bindings for Python, Node.js and WebAssembly, plus a C ABI that C, C++,
|
|
23
|
+
C# / .NET and any other C-capable language links against. Every indicator is a
|
|
24
|
+
state machine that updates in O(1) per new data point, so live trading bots and
|
|
23
25
|
historical backtests share the exact same implementation.
|
|
24
26
|
|
|
25
27
|
```python
|
|
@@ -46,7 +48,9 @@ Full documentation lives at **[docs.wickra.org](https://docs.wickra.org)**:
|
|
|
46
48
|
- **Quickstarts** — [Rust](https://docs.wickra.org/Quickstart-Rust),
|
|
47
49
|
[Python](https://docs.wickra.org/Quickstart-Python),
|
|
48
50
|
[Node](https://docs.wickra.org/Quickstart-Node),
|
|
49
|
-
[WASM](https://docs.wickra.org/Quickstart-WASM)
|
|
51
|
+
[WASM](https://docs.wickra.org/Quickstart-WASM),
|
|
52
|
+
[C](https://docs.wickra.org/Quickstart-C),
|
|
53
|
+
[C#](https://docs.wickra.org/Quickstart-CSharp).
|
|
50
54
|
- **Indicators** — a per-indicator deep dive (formula, parameters, warmup) for
|
|
51
55
|
every one of the 514 indicators; start at the
|
|
52
56
|
[indicators overview](https://docs.wickra.org/Indicators-Overview).
|
|
@@ -71,9 +75,10 @@ times to get there.
|
|
|
71
75
|
breadth, Renko/Kagi/Point&Figure bars, Ehlers DSP cycles, risk/performance
|
|
72
76
|
metrics — every single one updating in **O(1) per tick**. TA-Lib ships ~150 and
|
|
73
77
|
none of them stream.
|
|
74
|
-
- **One Rust core,
|
|
75
|
-
WebAssembly · Rust**
|
|
76
|
-
reimplementation and zero
|
|
78
|
+
- **One Rust core, five first-class targets.** Native **Python · Node.js ·
|
|
79
|
+
WebAssembly · Rust** plus a **C ABI** for C / C++, C# / .NET and any other C-capable language —
|
|
80
|
+
identical math, identical results, zero per-language reimplementation and zero
|
|
81
|
+
GIL bottleneck.
|
|
77
82
|
- **Correct by construction, not by hope.** Every `update` validates its input,
|
|
78
83
|
runs a real warmup, and returns an `Option` so a single bad tick can't silently
|
|
79
84
|
poison state. `batch == streaming` is **bit-exact, fuzzed and 100 %-line-covered
|
|
@@ -95,7 +100,8 @@ Every other library forces one of those compromises. Wickra doesn't:
|
|
|
95
100
|
|
|
96
101
|
| Library | Install | Streaming | Languages | Indicators | Active |
|
|
97
102
|
|------------------|-------------|-------------|-----------------------------|-----------:|--------|
|
|
98
|
-
| **★ Wickra**| **clean** | **yes, O(1)** | **Python · Node · WASM
|
|
103
|
+
| **★ Wickra**| **clean** | **yes, O(1)** | **Rust · Python · Node · WASM** | **514** | **yes** |
|
|
104
|
+
| | | | **C · C#** | | |
|
|
99
105
|
| kand | clean | yes | Python · WASM · Rust | ~60 | yes |
|
|
100
106
|
| ta-rs | clean | yes | Rust only | ~30 | stale |
|
|
101
107
|
| yata | clean | partial | Rust only | ~35 | yes |
|
|
@@ -166,8 +172,9 @@ as one column each. `Doji` is direction-less by default (`+1.0` / `0.0`);
|
|
|
166
172
|
construct it in signed mode (`Doji::new().signed()`, `Doji(signed=True)`,
|
|
167
173
|
`new Doji(true)`) for a dragonfly / gravestone `±1` reading.
|
|
168
174
|
|
|
169
|
-
Adding a new indicator means implementing one trait in Rust;
|
|
170
|
-
|
|
175
|
+
Adding a new indicator means implementing one trait in Rust; every binding
|
|
176
|
+
inherits it automatically (the C ABI — and the C# binding generated from it —
|
|
177
|
+
regenerate from the core).
|
|
171
178
|
|
|
172
179
|
## Languages
|
|
173
180
|
|
|
@@ -177,12 +184,15 @@ inherit it automatically.
|
|
|
177
184
|
| Node.js (napi-rs) | `npm install wickra` | `examples/node/backtest.js` |
|
|
178
185
|
| Browser / WASM | `npm install wickra-wasm` | `examples/wasm/index.html` |
|
|
179
186
|
| Rust | `cargo add wickra` | `examples/rust/src/bin/backtest.rs` |
|
|
187
|
+
| C / C++ (C ABI) | header + library, see [`bindings/c`](bindings/c) | `examples/c/streaming.c` |
|
|
188
|
+
| C# / .NET (C ABI) | `dotnet add package Wickra`, see [`bindings/csharp`](bindings/csharp) | `examples/csharp/streaming` |
|
|
180
189
|
|
|
181
190
|
Each binding ships several runnable examples (streaming, backtest, live feed);
|
|
182
191
|
[`examples/README.md`](examples/README.md) is the full cross-language index.
|
|
183
192
|
|
|
184
|
-
The wickra-core crate is `unsafe`-forbidden, so
|
|
185
|
-
memory-safe
|
|
193
|
+
The wickra-core crate is `unsafe`-forbidden, so the native bindings are
|
|
194
|
+
memory-safe end to end. The C ABI runs the same safe core; only its thin FFI
|
|
195
|
+
boundary uses `unsafe`, and the caller owns handle lifetimes (`_new` / `_free`).
|
|
186
196
|
|
|
187
197
|
## Rust API
|
|
188
198
|
|
|
@@ -244,13 +254,17 @@ wickra/
|
|
|
244
254
|
├── bindings/
|
|
245
255
|
│ ├── python/ PyO3 + maturin (publishes on PyPI)
|
|
246
256
|
│ ├── node/ napi-rs (publishes on npm)
|
|
247
|
-
│
|
|
257
|
+
│ ├── wasm/ wasm-bindgen (browsers, bundlers, Node)
|
|
258
|
+
│ ├── c/ C ABI (cdylib + staticlib) + generated include/wickra.h
|
|
259
|
+
│ └── csharp/ .NET binding over the C ABI (publishes on NuGet)
|
|
248
260
|
├── examples/ examples/README.md indexes every language
|
|
249
261
|
│ ├── data/ real BTCUSDT OHLCV datasets, one per timeframe
|
|
250
262
|
│ ├── rust/ Rust workspace member (`wickra-examples`)
|
|
251
263
|
│ ├── python/ backtest, live trading, parallel assets, multi-tf
|
|
252
264
|
│ ├── node/ streaming, backtest, live trading (load `wickra`)
|
|
253
|
-
│
|
|
265
|
+
│ ├── wasm/ browser demo for `wickra-wasm`
|
|
266
|
+
│ ├── c/ C smoke + streaming, C++ RAII wrapper
|
|
267
|
+
│ └── csharp/ streaming, backtest, strategies (load `Wickra`)
|
|
254
268
|
└── .github/workflows/ CI and release pipelines
|
|
255
269
|
```
|
|
256
270
|
|
|
@@ -278,6 +292,14 @@ wasm-pack build bindings/wasm --target web --release --features panic-hook
|
|
|
278
292
|
|
|
279
293
|
# Node binding (requires @napi-rs/cli)
|
|
280
294
|
cd bindings/node && npm install && npm run build && npm test
|
|
295
|
+
|
|
296
|
+
# C ABI (cdylib + staticlib + generated header)
|
|
297
|
+
cargo build -p wickra-c --release
|
|
298
|
+
cmake -S examples/c -B examples/c/build -DWICKRA_LIB_DIR="$PWD/target/release"
|
|
299
|
+
cmake --build examples/c/build && ctest --test-dir examples/c/build --output-on-failure
|
|
300
|
+
|
|
301
|
+
# C# / .NET binding (requires the .NET 8 SDK; links the C ABI above)
|
|
302
|
+
dotnet test bindings/csharp/Wickra.Tests/Wickra.Tests.csproj
|
|
281
303
|
```
|
|
282
304
|
|
|
283
305
|
## Testing
|
package/package.json
CHANGED
package/wickra_wasm_bg.wasm
CHANGED
|
Binary file
|