
Setup
Bootstrap a reproducible Python venv with VectorBT, OpenAlgo, TA-Lib, and plotly plus a backtesting folder layout on macOS, Linux, or Windows.
Overview
setup is an agent skill for the Build phase that creates a Python virtual environment, installs TA-Lib and VectorBT/OpenAlgo dependencies, and scaffolds backtesting folders per OS.
Install
npx skills add https://github.com/marketcalls/vectorbt-backtesting-skills --skill setupWhat is this skill?
- OS detection via uname with Darwin/Linux/Windows mapping before install commands
- Virtualenv in ./venv with platform-specific activate and pip upgrade
- TA-Lib C library install first (brew vs apt/wget) then Python ta-lib wheel
- Install stack: openalgo, vectorbt, plotly, and related backtesting dependencies
- Optional python-version argument for venv creation (e.g. python3.12)
- Five-step workflow: detect OS, venv, TA-Lib system dep, pip packages, backtesting folder structure
Adoption & trust: 1k installs on skills.sh; 150 GitHub stars; 0/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want to backtest strategies with VectorBT and OpenAlgo but pip installs fail on TA-Lib and your venv differs across Mac, Linux, and Windows.
Who is it for?
Solo quant builders starting a local VectorBT + OpenAlgo project on a fresh clone or new machine.
Skip if: Cloud-only notebooks with prebuilt images, Rust-only trading stacks, or repos where TA-Lib and venv are already locked in CI.
When should I use this skill?
Set up the Python backtesting environment for VectorBT + OpenAlgo; optional argument-hint python-version.
What do I get? / Deliverables
You get an activated venv with upgraded pip, OS-appropriate TA-Lib, Python packages installed, and a backtesting folder structure ready for downstream VectorBT skills.
- venv with activated environment
- Installed openalgo, ta-lib, vectorbt, plotly stack
- Backtesting directory layout
Recommended Skills
Journey fit
Quant backtesting infrastructure is assembled in Build before you run strategies, tests, or automation in later phases. Virtualenv creation, OS-level TA-Lib, and pip dependency wiring are environment/backend setup steps, not distribution or live trading ops.
How it compares
Use this gated OS-aware bootstrap instead of a single pip install line that breaks on missing TA-Lib system libraries.
Common Questions / FAQ
Who is setup for?
Indie developers and solo traders setting up Python backtesting with VectorBT, OpenAlgo, and TA-Lib on macOS, Linux, or Windows.
When should I use setup?
At the beginning of Build on a new backtesting repo, before writing strategies, or when migrating Python versions using the optional python-version argument.
Is setup safe to install?
It runs shell commands including brew, apt, wget, and pip—review the Security Audits panel on this Prism page and inspect scripts before sudo or network installs on production hosts.
SKILL.md
READMESKILL.md - Setup
Set up the complete Python backtesting environment for VectorBT + OpenAlgo. ## Arguments - `$0` = Python version (optional, default: `python3`). Examples: `python3.12`, `python3.13` ## Steps ### Step 1: Detect Operating System Run the following to detect the OS: ```bash uname -s 2>/dev/null || echo "Windows" ``` Map the result: - `Darwin` = macOS - `Linux` = Linux - `MINGW*` or `CYGWIN*` or `Windows` = Windows Print the detected OS to the user. ### Step 2: Create Virtual Environment Create a Python virtual environment in the current working directory: **macOS / Linux:** ```bash python3 -m venv venv source venv/bin/activate pip install --upgrade pip ``` **Windows:** ```bash python -m venv venv venv\Scripts\activate pip install --upgrade pip ``` If the user specified a Python version argument, use that instead of `python3`: ```bash $PYTHON_VERSION -m venv venv ``` ### Step 3: Install TA-Lib System Dependency TA-Lib requires a C library installed at the OS level BEFORE `pip install ta-lib`. **macOS:** ```bash brew install ta-lib ``` **Linux (Debian/Ubuntu):** ```bash sudo apt-get update sudo apt-get install -y build-essential wget wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz tar -xzf ta-lib-0.4.0-src.tar.gz cd ta-lib/ ./configure --prefix=/usr make sudo make install cd .. rm -rf ta-lib ta-lib-0.4.0-src.tar.gz ``` **Linux (RHEL/CentOS/Fedora):** ```bash sudo yum groupinstall -y "Development Tools" wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz tar -xzf ta-lib-0.4.0-src.tar.gz cd ta-lib/ ./configure --prefix=/usr make sudo make install cd .. rm -rf ta-lib ta-lib-0.4.0-src.tar.gz ``` **Windows:** ``` pip install ta-lib ``` If that fails, download the appropriate .whl file from https://github.com/cgohlke/talib-build/releases and install with: ```bash pip install TA_Lib-0.4.32-cp312-cp312-win_amd64.whl ``` ### Step 4: Install Python Packages Install all required packages (latest versions): ```bash pip install openalgo vectorbt plotly anywidget nbformat ta-lib pandas numpy yfinance python-dotenv tqdm scipy numba nbformat ipywidgets quantstats ccxt duckdb psutil ``` ### Step 5: Create Backtesting Folder Create only the top-level backtesting directory. Strategy subfolders are created on-demand when a backtest script is generated (by the `/backtest` skill). ```bash mkdir -p backtesting ``` Do NOT pre-create strategy subfolders. ### Step 6: Configure .env File **6a. Check if `.env.sample` exists at the project root.** If it does, use it as a template. **6b. Ask the user which markets they will be backtesting** using AskUserQuestion: - Indian Markets (OpenAlgo) — requires OpenAlgo API key - Indian Markets (DuckDB) — direct database loading, no API needed - US Markets (yfinance) — no API key needed - Crypto Markets (CCXT) — optional API key for private data **6c. If the user selected Indian Markets**, ask for their OpenAlgo API key: - Ask: "Enter your OpenAlgo API key (from the OpenAlgo dashboard):" - If the user provides a key, store it in `.env` - If the user skips, write a placeholder **6d. If the user selected Indian Markets (DuckDB)**, ask for the DuckDB database path: - Ask: "Enter the path to your DuckDB database file (e.g., D:/data/market_data.duckdb):" - Auto-detect format: If the database has a `market_data` table with `symbol, exchange, interval, timestamp` columns, it is OpenAlgo Historify format (store as `HISTORIFY_DB_PATH`). Otherwise store as `DUCKDB_PATH`. - If the user also has OpenAlgo Historify, ask: "Is this an OpenAlgo Historify database? (y/n)" **6e. If the user selected Crypto Markets**, ask if they want to configure exchange API