Local-first algorithmic trading platform

AlgoMLN

Build strategies. Backtest precisely. Trade confidently.

A fast, local-first algorithmic trading platform built in Rust. Engine-first by design — custom strategy DSL, deterministic backtests, and a plugin system powered by Rhai and WASM.

v0.1.0 beta Active Development

Built from the bottom up

Most trading platforms are UI-first. AlgoMLN is built engine-first — every layer is tested, deterministic, and production-grade before the next layer is added.

Data
Indicators
Strategy Engine
Backtesting
Execution
UI

Everything in one engine

One execution path from backtest to live. No hidden code paths, no divergence.

Strategy Engine
Custom DSL compiles to an AST and evaluates candle-by-candle deterministically. Trigger state machine fires rules only on false → true transitions.
DSL AST Deterministic
Deterministic Backtests
Same strategy + same candles = identical output every time. Tested on 184,863 NIFTY 1-min candles at ~52,000 candles/sec.
184k candles 3.5s runtime
Plugin System
Extend the engine with Rhai scripts or WASM modules. Capability-gated — plugins only access what they declare.
Rhai WASM 8 Capabilities
Indicator Engine
7 built-in pure Rust indicators — stateless functions with bounded windows for O(N) performance. Custom indicators via plugin API.
EMARSI ATRVWAP Bollinger
Data Layer
Broker abstraction with a WebSocket manager supporting up to 1,000 symbol subscriptions with auto-reconnect and tick fan-out.
Dhan API WebSocket 1,000 symbols
Unified Execution
PaperBroker and live brokers are interchangeable behind the ExecutionTarget trait. Backtests, paper trading, and live trading share one engine.
Paper Trading Live (Phase 7)

Strategies in plain text

Write strategies in .algomln files — a small, rules-only DSL. No variables. No loops. Just conditions and actions.

The .algomln Language

Rules compile from source text through a full lexer → parser → AST → validator pipeline before hitting the runtime engine. Same code runs backtests, paper trading, and live.

Lexer Parser AST Validator Runtime
ema_crossover.algomln
# EMA crossover strategy
WHEN cross_above(ema(20), ema(50))
BUY 10

WHEN cross_below(ema(20), ema(50))
SELL ALL

# RSI filter on top
WHEN ema(9) > ema(21) AND rsi(14) < 60
BUY 5

# Bollinger band breakout
WHEN close < bb_lower(20)
BUY 10

WHEN rsi(14) > 75
SELL ALL

Measured. Verified. Fast.

Benchmarked on a stock i5 8th gen — not a server, not a workstation.

184k
Candles
Full NIFTY 1-min history
3.5s
Runtime
Full backtest, release build
52k
Candles/sec
On i5 8th gen
132
Tests
Passing · 0 failed

Build progress

AlgoMLN is being built engine-first. Each layer is tested before the next is added.

Phase 1 — Data Layer
Broker abstraction, DhanClient, WebSocket manager, historical OHLCV, Tauri IPC.
Phase 2 — Indicator Engine
Pure Rust stateless functions: MA, EMA, RSI, ATR, VWAP, Rel Vol, Bollinger Bands.
Phase 2.5–2.9 — Strategy Engine
Full DSL compiler pipeline, PaperBroker, ExecutionTarget, deterministic backtest replay.
Phase 3–5 — UI Shell
Visual strategy builder, strategies list, settings, coder modal, uploader modal, scaling shell.
Phase 6 — Plugin System
Rhai + WASM runtimes, capability gating, event bus, scheduler, UI broadcast, desktop Plugins screen.
Phase 6.5 — Advanced Strategy
Position sizing, stop loss/take profit, risk controls, multi-symbol strategies.
Phase 4 — Trading Tools
Option chain viewer, open interest analysis, payoff diagrams, screener.
Phase 7 — Live Trading
Live broker execution, two-step confirmation, risk limits, immutable trade log.