On this page
We research, test and run systematic trading strategies on one small server. This is the whole setup: what each part does, why we chose it, and how to build the same thing for your own backtesting and trading. Strategies and results are left out; the setup does not depend on them.
The parts
| Part | What we use | Why |
|---|---|---|
| Server | A Hetzner cloud server: Debian 13, 2 vCPUs, 8 GB of memory | Enough for daily and hourly data on hundreds of markets, at a small monthly cost |
| Private network | Tailscale | SSH, the dashboard and the notebooks can be reached only from our own devices |
| Market data | Python scripts (standard library only) for history; small Rust programs for live order books | Few dependencies; a recorder must never drop data |
| Data store | Parquet files, read as VectorBT PRO data | One format for every dataset, fast to load |
| Backtesting | VectorBT PRO, with its Rust backend | One engine for every test; every portfolio is saved and can be reopened |
| Notebooks | JupyterLab | To look into saved portfolios by hand |
| Scheduling | Dagster | Every daily step as an asset, with logs, a schedule and one job at a time |
| Dashboard | A small Rust web server and a plain HTML page; charts are Plotly figures saved by VectorBT PRO | Fast, simple and private |
| Execution | A Rust program that turns each day's targets into orders | Stable, and separate from research |
| Records | Git and a notes vault | Every plan before a test, every result after it |
Versions on our server today: Python 3.12, VectorBT PRO 2026.10, pandas 3.1, Dagster 1.13, JupyterLab 4.6, Rust 1.100, Tailscale 1.104.
1. The server
Rent a small Linux server and create it with your SSH key. We use Hetzner, in Helsinki. Then:
apt update && apt full-upgrade -y
apt install -y unattended-upgrades fail2ban ufw git curl zstd python3-venv build-essential
curl -fsSL https://tailscale.com/install.sh | sh
tailscale up
Allow only the private network, and turn off passwords for SSH. Allow tailscale0 before you enable the firewall, or you lock yourself out.
ufw default deny incoming
ufw default allow outgoing
ufw allow in on tailscale0
ufw enable
printf 'PasswordAuthentication no\nPermitRootLogin prohibit-password\n' > /etc/ssh/sshd_config.d/10-hardening.conf
systemctl reload ssh
From then on the server is reached by its Tailscale name only. One user runs everything; code, data and keys are kept apart:
useradd --system --create-home --shell /usr/sbin/nologin trader
install -d -o root -g trader -m 750 /opt/trader # code: the service user can read it, not change it
install -d -o trader -g trader -m 750 /var/lib/trader # data
install -d -o root -g root -m 700 /etc/trader # keys: root only
Every program runs as a systemd service in a sandbox: it can write only its own folder, and it cannot see the keys.
[Service]
User=trader
ExecStart=/opt/trader/venv/bin/python /opt/trader/research/fetch_funding.py --out /var/lib/trader/funding
ProtectSystem=strict
ReadWritePaths=/var/lib/trader/funding
InaccessiblePaths=-/etc/trader
NoNewPrivileges=true
PrivateTmp=true
MemoryMax=1G
2. Data
Most of what you need is free:
- Binance's public archive, https://data.binance.vision: daily and monthly files of bars, funding and positioning for every perpetual future ever listed, including those since delisted. Without the delisted ones a backtest sees only the survivors.
- Exchange APIs: Hyperliquid and Lighter publish prices, funding history and order books.
- FRED for rates, indices and currencies; the US Treasury's Fiscal Data API for auctions; CoinGecko and DefiLlama for crypto market values and stablecoin supply.
When fetching:
- One small script per source, standard library only, run once a day.
- Merge each answer into the stored file; a shorter answer never replaces stored history.
- Respect rate limits, and stop on a refusal instead of retrying hard.
- Write to a temporary file and rename it, so a crash never leaves half a file.
For live order books we run a small Rust program per exchange. It subscribes to the exchange's WebSocket feed and writes every message to an hourly zstd-compressed file of JSON lines, with a status file the dashboard reads.
Then check the data before any test, every day: missing days, duplicate bars, days without a trade, stale files, prices before a market listed. We found two faults in our own store this way, contracts split in two around missing archive days and prices recorded before a listing, and both would have changed results.
3. One engine for every backtest
VectorBT PRO (https://vectorbt.pro) is a paid Python library that backtests whole tables of markets at once, with a Rust backend for speed. Our rule: every backtest, every figure and every chart goes through it. Results from our own hand-written simulators differed from it in small ways that mattered, and we withdrew them. The open-source vectorbt is a free place to start.
import vectorbtpro as vbt
data.to_parquet("/var/lib/trader/vbt/data/perp_1d") # once, when the dataset is built
data = vbt.ParquetData.pull("/var/lib/trader/vbt/data/perp_1d") # in every study
pf = vbt.Portfolio.from_orders(data.close, size=weights, size_type="targetpercent",
group_by=True, cash_sharing=True, fees=0.0005)
pf.save("/var/lib/trader/vbt/portfolios/study_01.pickle") # reopen with vbt.Portfolio.load
Things that caught us out, worth checking in any engine:
- A stop or a target is not tested on the bar the entry is recorded on. Record the entry on the bar before, or check that bar yourself.
- A market that stops trading has to be closed at its last price, or the backtest holds it for ever.
- With borrowed money, check how funding is charged once cash goes below zero. We keep gross exposure under about two thirds of the account, so there is always free cash.
- Five-minute data of many markets needs gigabytes for one portfolio. Run heavy jobs one at a time, with a memory cap.
4. A method that keeps you honest
The method matters more than the tools:
- Write the plan before you run the test: the question, the data, the conditions it must meet, and your own estimate of the chance that it will. Commit it to Git, so it is dated.
- Count every variant you try. The more you try, the higher the bar; the deflated Sharpe ratio corrects for it.
- Test at more than one cost level, on a second set of markets, and on the last third of the data alone.
- When a rule passes, freeze it and record it forward, day by day, on data it has never seen.
- Never test on made-up data. Real bars only.
- Keep a dated notebook: aim, method, result, limits.
The papers behind this are in our reading list.
5. Run the routine without anyone in the loop
Dagster runs the daily work as a chain of assets: fetch, build each dataset, audit it, run the studies, update the trackers, write the next day's targets. Each asset runs a script in its own process, so a heavy step cannot take the scheduler down with it.
import subprocess
import dagster as dg
def run(*args):
subprocess.run(["/opt/trader/venv/bin/python", *args], cwd="/opt/trader/research", check=True)
@dg.asset
def raw_funding():
run("fetch_funding.py", "--out", "/var/lib/trader/funding")
@dg.asset(deps=[raw_funding])
def funding_1h():
run("-m", "lab.store", "build", "funding_1h")
daily = dg.define_asset_job("daily", selection=dg.AssetSelection.assets(raw_funding, funding_1h))
defs = dg.Definitions(assets=[raw_funding, funding_1h], jobs=[daily],
schedules=[dg.ScheduleDefinition(job=daily, cron_schedule="20 0 * * *", execution_timezone="UTC")])
Run Dagster's web page and its daemon as two services, and on a small server let it run one job at a time (max_concurrent_runs: 1 in dagster.yaml). A step that fails stops and waits for a person.
6. A private dashboard
The dashboard is a small Rust web server (axum) that reads the JSON files the research writes and serves one plain HTML page. Charts are Plotly figures that VectorBT PRO drew and saved as JSON; the page draws them with the same Plotly version. It is bound to the Tailscale address only, so it does not exist on the public internet. It also holds a Kanban board for the work in hand.
7. Deploy one part at a time
The trading program has to keep running while research and pages change, so each part is deployed on its own, with one command from the workstation:
./scripts/deploy.sh ui # the page: a new release folder, switched by one link; nothing restarts
./scripts/deploy.sh research # strategies, studies, the schedule: waits until no job is running
./scripts/deploy.sh monitor # the dashboard's server
./scripts/deploy.sh recorders # the data recorders
./scripts/deploy.sh engine # the trading program: only when named
The script ships only committed code (git archive of HEAD), builds on the server, restarts only what changed, holds a lock so two deploys never overlap, and keeps the last dozen page releases for an instant rollback.
8. From targets to orders
Research decides; a separate program executes. Each day the schedule writes a targets file: for each market, long or short and its share of the account. The execution program, in Rust, reads it, checks it (well formed, dated today, within the limits in its own settings file), compares it with the account and sends the orders. If the file is missing or wrong it keeps the last good one and says why. A change of strategy reaches it through the targets file, a change of size or limits through its settings file; its own code changes rarely.
Keys: create them yourself in the exchange's interface, store them on the server in a file only root can read, and hand them only to the execution service (systemd's LoadCredential does this). Never put them in Git, in a notebook or in a chat. Start in dry run, where the program logs the orders it would send; then run it beside the market without orders; then with a small account; only then at size.
Our execution program for Lighter is being built now, to this design.
What it costs
The server costs little each month and VectorBT PRO is a paid subscription. The data, Tailscale for personal use, Dagster, JupyterLab, Rust and Python are free. Most of the time goes into data and checks, not strategies.
If you build one
- Start with one market's daily data, one fetcher, one dataset and one study, and automate that before adding more.
- Put every backtest through one engine.
- Write the plan before each test.
- Check the data every day.
- Keep the trading program separate from everything else, and deploy it only on purpose.
- Keep keys out of everything but the one service that needs them.