# Alpaca Trading Bot - Paper-First Intraday Stock Bot

> Your agent installs and runs a complete intraday trading bot for US stocks and ETFs on your own Alpaca account. EMA/RSI/volume signals on finished 5-minute bars, bracket stop-loss and take-profit on every trade, 3% daily loss limit, end-of-day flatten. Paper trading by default.

Alpaca Trading Bot - Paper-First Intraday Stock Bot is a paid AI agent skill on Agensi by Mayank Sharma, in Trading & Investing. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $1 (one-time purchase)
- Creator: [Mayank Sharma](https://www.agensi.io/creators/mayank-sharma)
- Category: [Trading & Investing](https://www.agensi.io/skills/trading-investing)
- Version: 1.0
- Last updated: 2026-11-22
- Security: scan passed (2026-11-22); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/alpaca-trading-bot-paper-first-intraday-stock-bot
- Tags: trading, python, alpaca-api, automation, finance

## About this skill

Install a working algorithmic trading bot in a few minutes, straight from your agent. The agent writes the bot into a folder on your machine, installs its Python packages, has you put your Alpaca paper keys into a local `.env` file (keys never go through the chat), checks the connection, and starts it.

### What it does

- Trades up to 25 liquid US stocks and ETFs (AAPL, MSFT, NVDA, SPY, QQQ and more), long and short
- Scores EMA 9/21 trend and crossovers, the 15-minute trend, RSI and volume surges on **finished** 5-minute bars
- Every entry is a bracket order: stop-loss at 1.5x ATR, take-profit at 2x the risk
- Risk limits: 1% risk per trade, max 8 positions, 50% gross exposure, 3 new entries per minute
- **Daily loss limit:** down 3% vs the previous close, it closes everything and stops for the day
- Flattens all positions 5 minutes before the close
- Optional always-on setup on any small Linux server (systemd guide included)

### Safety first

- **Paper trading is the default.** The agent is instructed never to switch to live trading unless you ask for it explicitly and confirm.
- Your API keys stay in a local `.env` file. The agent never asks for them in chat or prints them.
- Network access is Alpaca only (plus PyPI during install).

### Limitations

- US stocks and ETFs during regular market hours only; no options or crypto
- Uses Alpaca's free IEX data feed, which covers only part of US trading volume
- Shorting needs a margin-enabled account
- No backtest or performance record is included, and paper results don't predict live results

### Disclaimer

This is software, not investment advice. It makes no promise of profit, and trading can lose money. You are responsible for your account and the trades it places.

## Requires

- Python 3.10+
- Alpaca account (free paper trading)

Use your Alpaca PAPER keys. You type them into the local .env file yourself; the agent never asks for them in chat.

## Known limitations

US stocks/ETFs only. No crypto or options. Uses Alpaca IEX data feed. Requires Python 3.10+. No built-in backtesting suite. Shorting requires margin account.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Alpaca Trading Bot - Paper-First Intraday Stock Bot skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What files and assets are included in this download?

The full Python source of the bot (bot.py plus its core/ and analytics/ modules), a requirements.txt, an env.example template for your Alpaca keys, a systemd service file and a step-by-step guide for running it always-on on a Linux server. Your agent writes these into a folder on your machine.

### Which platforms or AI agents are required to run this trading bot?

The bot is built for Python 3.10+ and requires a free or paid Alpaca account; it is compatible with any AI agent or IDE capable of running Python scripts and managing environment variables.

### Can I test the bot in a sandbox environment before trading live?

Yes, the bot is set to paper trading by default, allowing you to test the EMA and RSI signals with virtual currency before committing any real capital.

### Are there any specific market or asset limitations I should be aware of?

It trades US stocks and ETFs only, during regular market hours (no options, crypto or extended hours). Signals use Alpaca's free IEX data feed, which covers only part of US volume, and shorting needs a margin-enabled account. Its risk limits (1% risk per trade, max 8 positions, 3% daily loss limit) reduce risk but cannot prevent losses.

### How does the bot handle open positions at the end of the trading day?

Five minutes before the close it closes every open position (selling longs and buying back shorts), so nothing is held overnight. The stop-loss and take-profit orders attached to each trade are cancelled with it.

### Can it trade with real money?

Yes, but only if you ask for it explicitly. Paper trading is the default, and the agent is instructed to warn you and get a clear yes before switching to live. Live trading uses real money and can lose it; this skill is software, not investment advice.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
