Skip to content
sigc

Quickstart

From cargo install to a backtest in five minutes.

No account, no hosted service. Install the binary, write one file, and run.

  1. 1

    Install the CLI

    sigc is published to crates.io. Install the CLI with Cargo (Rust 1.70+). For notebooks, the pysigc binding installs from PyPI.

    $ cargo install sigc
    # optional Python binding
    $ pip install pysigc
  2. 2

    Write a .sig strategy

    A strategy is one file with four blocks: data, params, one or more signal blocks, and a portfolio block. Save this as momentum.sig.

    data:
      prices: load parquet from "prices.parquet"
    
    params:
      lookback = 20
      top_pct  = 0.2
    
    signal momentum:
      returns = ret(prices, lookback)
      emit winsor(zscore(returns), p=0.01)
    
    portfolio main:
      weights = rank(momentum).long_short(top=top_pct, bottom=top_pct)
      backtest from 2024-01-01 to 2024-12-31
  3. 3

    Compile and backtest

    sigc run parses the file, type-checks shapes and calendars, executes on Polars/Arrow, caches the result by content hash, and prints the standard metrics.

    $ sigc run momentum.sig
    # Total Return  18.4%
    # Sharpe        1.45
    # Max Drawdown  8.12%
    # Turnover      42%
    # compiled in 2ms, backtested in 45ms
  4. 4

    Iterate with params

    Override any parameter from the CLI without editing the file. The content-addressed cache means unchanged sub-computations are reused instantly.

    $ sigc run momentum.sig --param lookback=40 --param top_pct=0.1
  5. 5

    Promote to production

    Run the exact same binary as a daemon. It owns the cache and serves compile/run requests over nng. Declare risk posture in sigc.yaml.

    $ sigc daemon
    # listening on tcp://127.0.0.1:7240 (nng REQ/REP)