Nero v1 - Trading Bot Script with Strategy (for Alpaca.markets)
Nero v1 Trading Bot (Alpaca + Python)
Nero v1 is a simple, rule-based momentum pullback bot you can run on Alpaca 24/7 from a cheap cloud VM. It scans a watchlist, waits for an “uptrend + pullback” setup, then places a bracket order with an ATR-based stop loss and take profit. The goal is boring execution with consistent risk control, not “AI magic.”
Why Nero v1?
2016-01-01 - 2026-01-01 Period:
- Starting Value: $10,000
- Final Value: $83,807 ✅
- Return: +738.1% ✅
- Win Rate: 43.6% ✅
- Max Drawdown: 33.3% ✅
- Total Trades: 250
What Exactly is included in the package?
1. nero-v1.py (the bot)
2. backtest-nero-v1.py (you could test the strategy ony historical data)
3. config.yaml (that includes your Alpaca.market credentials)What Nero v1 actually does
Nero v1 loops forever, but it only tries to trade while the market is open by checking Alpaca’s market clock. When markets are closed, it just prints a countdown to the next open. nero-v1
Under the hood, it:
- pulls recent 1-minute bars from Alpaca
- calculates indicators
- checks if there is already a position
- if a setup appears, it sizes the trade based on account equity and volatility
- submits a bracket order (market entry + stop loss + take profit) v
How it works with Alpaca
Alpaca.markets provides:
- the brokerage account (paper or live)
- a market clock endpoint so you can check open/close state
Nero v1 connects using API keys loaded from config.yaml (you need to include your owns during the setup).
What you need before setup?
A quick checklist:
- Part 1: An Alpaca account (paper is fine to start) - see the guide below
- Part 2: A Google Cloud VM (Ubuntu/Linux) with Python 3.9+ and required libraries to run the script - see the guide below
- Part 3: Upload the bot script to your Google Cloud VM and start it - see the guide below
Part 1: Create an Alpaca account and generate API keys
Create your Alpaca account (Trading API account), then go to your Alpaca dashboard and generate API keys. Alpaca’s docs explicitly point you to the dashboard “API Keys” section where you can generate new keys and save them.
Important detail: paper trading (no money needed) and live trading (using real money) use different API keys, and the paper environment has its own endpoint.
You need to save these details into config.yaml next to your bot script.
Paper trading endpoint
Many setups use https://paper-api.alpaca.markets for paper trading. The official docs note that the endpoint is shown in your paper dashboard and differs from live.
If you switch to live account, the endpoint url will change to https://api.alpaca.markets
Configure Nero v1 to connect to Alpaca
Nero v1 reads credentials from config.yaml. The script expects these fields: API_KEY, API_SECRET, BASE_URL.
Config.yaml template included in the download package. How it looks like:
Config.yaml:
API_KEY: "YOUR_KEY_ID"
API_SECRET: "YOUR_SECRET"
BASE_URL: "https://paper-api.alpaca.markets"Part 2: A Google Cloud VM (Ubuntu/Linux) with Python 3.9+ and required libraries
Create an Ubuntu e2-micro VM in Google Cloud
Open Google Cloud Console → Compute Engine → VM instances → Create instance. Google’s official “create a Linux VM” flow is basically this page, just in console form.
Set these options:
Name
-
nero-v1-bot(or anything you like)
Region / Zone
- Pick a region close to you. If you’re cost-optimizing, you can also pick regions where the free-tier e2-micro is available (Google mentions 1 e2-micro VM free per month, depending on eligibility and region).
Machine type
- E2 → e2-micro (this will cost you max. $1 per month)
- E2 is Google’s low-cost general-purpose series, good enough for a single lightweight trading bot.
Boot disk
- Click Change
- Operating system: Ubuntu
- Version: Ubuntu 24.04 LTS (or 22.04 LTS)
- Both are fine. Both include Python 3.9+ out of the box.
Firewall
- You do not need HTTP/HTTPS for this bot.
- Leave “Allow HTTP traffic” and “Allow HTTPS traffic” unchecked unless you know you need them.
Click Create.
Open SSH in the browser
In the VM instances list, click SSH → Open in browser window.
This is where you’ll run all commands below.
Install dependencies first (before you upload files)
Run:
sudo apt update
sudo apt -y upgrade
sudo apt -y install python3 python3-pip git screenInstall Python libraries
Your script imports: alpaca_trade_api, pandas, pandas_ta, and yaml (PyYAML). nero-v1
Install them for your user:
pip3 install --user --upgrade pip
pip3 install --user alpaca-trade-api pandas pandas_ta pyyamlPart 3: Upload the bot script
Upload nero-v1.py and config.yaml (with the inserted API credentials) into your home directory. There is an "Upload File" button on the top right part of your SSH-in-browser.
Run once (foreground)
From home:
cd ~
python3 nero-v1.pyIf it connects successfully, you’ll see it load config, connect to Alpaca, and then it start scanning and makes the initial purchase moves based on it's strategy or show the market closed countdown.
Stop it with Ctrl+C.
Run 24/7 using screen (no tmux, no venv)
Start a named screen session
cd ~
screen -S neroNow start the bot:
python3 nero-v1.pyDetach screen (keep it running)
Press:
-
Ctrl + A, thenD
Your bot keeps running even if you close the SSH tab.
Reconnect later
SSH into the VM again, then:
screen -ls
screen -r neroIf it says it’s “attached” (happens after disconnects), force reattach:
screen -d -r neroThe above will method will only stop the script/bot running, when you reboot the VM on Google Cloud.