Setup
Strategies are written in Rust. The backtest engine runs in the cloud, so there's nothing heavy to install, the fastest path has no install at all.
New here? See Ways to use SignalAI for the web Studio, Claude connector, and local cargo crate.
1. Fastest, the Web Studio (nothing to install)
Go to signal-ai-mu.vercel.app/strategies and click Build strategy. Sign in with Google, describe your idea in chat, and the hosted agent writes the Rust for you. Set the run parameters (universe, date range, cash, resolution) in the side panel and run the backtest inline. No toolchain required.
2. Local dev, the signalai-quant crate
Prefer your own editor? Install Rust, then add the crate:
# install the Rust toolchain (once)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# in a new cargo project
cargo add signalai-quant
signalai-quant is published on crates.io. It's the API contract: your strategy type-checks and compiles locally against exactly the same types the server uses. The engine itself never ships, backtests still run in the cloud (submit from the Studio or Claude).
Write a strategy against the crate's prelude:
use signalai_quant::prelude::*;
struct Momentum { sma: indicators::Sma, sym: SymbolId }
impl Strategy for Momentum {
fn init(&mut self, ctx: &mut Ctx) {
self.sym = ctx.universe()[0]; // symbols come from the run, never hard-coded
ctx.subscribe_bars(self.sym, Resolution::Day1);
}
fn on_bar(&mut self, ctx: &mut Ctx, bar: &Bar) {
let close = bar.close.as_f64();
let Some(avg) = self.sma.update(close) else { return }; // None until warm
let holding = !ctx.position(self.sym).is_zero();
if close > avg && !holding {
ctx.order(self.sym, Side::Buy, Qty::shares((ctx.cash() / close).floor()));
} else if close < avg && holding {
ctx.liquidate(self.sym);
}
}
}
pub fn build_strategy() -> Box<dyn Strategy> {
Box::new(Momentum { sma: indicators::Sma::new(20), sym: SymbolId(0) })
}
Type-check it locally:
cargo build # or: cargo test
3. From Claude
Author and run strategies straight from a Claude conversation via the MCP connector, no local setup at all. See Connect to Claude.
API tokens
For programmatic access, mint a token from API tokens and set SIGNALAI_TOKEN in your environment.