Skip to content

wickra-embedIndicators where there is no OS.

Allocation-free, #![no_std] streaming indicators for bare-metal and HFT — O(1) with bounded latency, fixed-capacity buffers, no heap. Byte-for-byte identical to wickra-core.

wickra-embed

Allocation-free, on bare metal

Every indicator is a fixed-size state machine. There is no Vec, no Box, no allocator call — the whole thing lives on the stack or in a static, so it runs on a microcontroller with a few KB of RAM, and its worst-case update latency is bounded.

rust
use embed_core::{Ema, Rsi, Indicator};

let mut ema = Ema::new(12).unwrap();
let mut rsi = Rsi::new(14).unwrap();

// Feed one tick; both update in O(1) with no allocation.
let e = ema.update(price);
let r = rsi.update(price);

Install

A Rust #![no_std] crate, plus a C ABI header + static library for firmware toolchains.

cargo add embed-core

Use it from Rust or C

The same five indicators — Sma, Ema, Rsi, Atr, Roc — from a Rust firmware project or a C / C++ toolchain.

#![no_std]
use embed_core::{Sma, Indicator};

let mut sma = Sma::new(20).expect("valid period");

for &price in &prices {
    // O(1), allocation-free; None during warmup.
    if let Some(avg) = sma.update(price) {
        // use avg — byte-identical to wickra-core
    }
}

Built on the Wickra core

wickra-embed is the no-alloc, bare-metal distillation of wickra-core. Each indicator is byte-for-byte identical to its std counterpart, so a signal computed on a microcontroller matches the one a server or a live chart would compute.

wickra-embed is a software library, not a trading system, and comes with no warranty — use at your own risk.