Taurus is a local AI trading strategy playground. You describe a strategy in plain English, Gemini turns it into code, the backend runs a backtest, and the frontend shows the result as an interactive graph with summary notes.
The project is split into two parts:
frontend/- Next.js app for entering prompts and viewing strategy resultsbackend/gemini_alpaca_agent/- Python strategy generator + backtesting engine
- Takes a natural-language trading prompt
- Generates a strategy file with Gemini
- Runs a local backtest using Alpaca market data
- Saves outputs for each run
- Displays performance graphs and summary notes in the frontend
- Next.js
- React
- Python
- Gemini API
- Alpaca API
- Pandas / NumPy
Taurus/
├─ frontend/
│ ├─ src/app/
│ └─ package.json
├─ backend/
│ ├─ requirements.txt
│ └─ gemini_alpaca_agent/
│ ├─ gemini_backtest_agent.py
│ ├─ alpaca_tools.py
│ ├─ backtester.py
│ ├─ strategy_tools.py
│ ├─ outputs/
│ └─ strategies/
└─ README.md
Before running the project, make sure you have:
- Node.js 18+ installed
- npm installed
- Python 3.10+ installed
- a Gemini API key
- Alpaca API keys
Create this file:
backend/gemini_alpaca_agent/.env
Use this format:
GEMINI_API_KEY=your_gemini_api_key
ALPACA_API_KEY=your_alpaca_api_key
ALPACA_SECRET_KEY=your_alpaca_secret_key
ALPACA_PAPER=true
ALPACA_DATA_FEED=iex
GEMINI_MODEL=gemini-3-flash-previewgit clone https://github.com/your-username/taurus.git
cd taurus/Tauruscd frontend
npm install
cd ..Windows PowerShell:
cd backend
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
cd ..macOS / Linux:
cd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cd ..You’ll usually want the frontend running, and the frontend will call the Python backend automatically.
cd frontend
npm run devOpen:
http://localhost:3000
Windows PowerShell:
cd backend\gemini_alpaca_agent
python .\gemini_backtest_agent.py "Generate me a strategy to buy Nvidia stock when it is at a month's low and sell at all time high."macOS / Linux:
cd backend/gemini_alpaca_agent
python gemini_backtest_agent.py "Generate me a strategy to buy Nvidia stock when it is at a month's low and sell at all time high."- Start the frontend with
npm run dev - Open
http://localhost:3000 - Enter a prompt describing a trading strategy
- Wait for Taurus to generate the strategy and run the backtest
- Review the graph, strategy notes, and metrics
Example prompt:
Generate me a strategy to buy Nvidia stock when it is at a month's low, and sell only at all time high for one year ago to Feb 2026.
Each successful run creates output files inside:
backend/gemini_alpaca_agent/outputs
Typical output includes:
run_metadata.json*_summary.json*_equity.csv*_trades.json*_pnl_log.json
These are used by the frontend to render graphs and summary information.
Run frontend:
cd frontend
npm run devLint frontend:
cd frontend
npm run lintBuild frontend:
cd frontend
npm run buildRun backend directly:
cd backend/gemini_alpaca_agent
python gemini_backtest_agent.py "your prompt here"Make sure your .env file exists at:
backend/gemini_alpaca_agent/.env
and includes:
GEMINI_API_KEY=your_key_hereCheck that a run created files inside:
backend/gemini_alpaca_agent/outputs/<run-name>/
especially:
*_pnl_log.json*_summary.json
Make sure your virtual environment is activated before running backend commands.
Double-check:
ALPACA_API_KEYALPACA_SECRET_KEYALPACA_DATA_FEED
- This is a local development project
- Backtests are hypothetical and not real financial advice
- The backtester currently supports long/flat strategies