Alpaca Trailing Stop Trading Bot
Turn Claude into a paper-trading bot that opens a position, protects downside with a trailing stop, and ladders in on drops.
Before & after
Same prompt, same agent — the only difference is the skill.
I can help you think through a trailing stop strategy for paper trading. A trailing stop is an order that follows the price up but doesn't move down. If you set a 10% trailing stop and the stock rises from $100 to $120, your stop moves from $90 to $108. To automate this, you'd typically: - Use a broker API that supports trailing stop orders - Set your initial position size - Configure the trail percentage - Monitor during market hours Alpaca offers a paper trading API that's free to use, which is good for testing strategies without risk. Note that I can't execute trades — you'd need to run this yourself. And this isn't investment advice. Want help thinking through the parameters?
PAPER TRADING BOT — configured. Alpaca paper account, no real money. CONNECTION Endpoint https://paper-api.alpaca.markets Key + secret in env, not in the config file. Verify you're on paper before anything else — the live and paper endpoints take the same credentials shape and the only difference is the URL. ENTRY BUY AAPL market, position size $2,000 (paper) TRAILING STOP — up only, never down Trail 8% from high-water mark. Entry $224 → stop $206 Price to $240 → stop moves to $220 Price back to $228 → stop STAYS $220 The stop is monotonic. That's the whole mechanic. LADDER BUYS on drawdown from entry −15% ($190) → add $500 −20% ($179) → add $500 −30% ($157) → add $1,000 Each rung fires once. Trailing stop recalculates off the new blended cost basis after each fill. SCHEDULE Every 5 minutes, 9:30–16:00 ET, Mon–Fri. No checks outside market hours — a gap-down opens below your stop and no polling interval changes that. WHAT IT LOGS EACH TICK timestamp · last · high-water mark · current stop · rungs filled · unrealized P/L 14:35 228.10 high 240.00 stop 220.80 rungs 0/3 +1.8% THE THING THAT WILL SURPRISE YOU Ladder buys and a trailing stop pull against each other: laddering in on the way down raises your basis exposure while the stop is trailing off a high you're moving away from. Watch the first drawdown closely — that interaction is where paper trading earns its keep. Paper account. Illustrative configuration, not investment advice.
About this skill
name: alpaca-trailing-stop-bot description: Turn Claude into a paper-trading bot that opens a position, protects downside with a trailing stop, and ladders in on drops.
Alpaca Trailing Stop Trading Bot
What This Does
The creator walks through connecting Claude Desktop to a free Alpaca paper trading account using the endpoint, key, and secret, then instructs Claude to buy a stock at market and manage a trailing stop that only moves up. He shows how to add ladder buys at -15%, -20%, -30% drawdowns and schedule Claude to check the position every 5 minutes during market hours Monday to Friday.
What You Get
- Alpaca paper account setup steps
- trailing stop rules Claude enforces
- ladder buy tiers with share counts
- scheduled 5-minute check during market hours
- live summary of every order placed
Customize
- ticker: symbol to trade (default Tesla)
- stop_loss_pct: percent below entry that triggers sell
- trail_pct: percent below high that floor tracks
- ladder_tiers: drawdown percentages that trigger buy-more
- schedule: which hours and days to monitor
Sample Output
Claude buys 10 shares of Tesla, sets a 10% stop, moves the floor up 5% every time the price climbs 10%, and adds 10 shares at -15% or 20 shares at -20%, then schedules itself to check every 5 minutes.
Target Audience
Retail traders using Claude Desktop and paper accounts to automate simple rules-based strategies
SKILL.md preview
---
name: alpaca-trailing-stop-bot
description: Use when a user wants Claude to manage a paper-trading position on Alpaca with a rising trailing stop and scheduled ladder buys on drawdowns.
version: 1.0.0
category: Trading
author: AgentVolt
license: proprietary
tags:
- trading
- standard
---
# Alpaca Trailing Stop Trading Bot
Manages a paper-trading position via the Alpaca API: opens a position, protects downside with a trailing stop that only moves up, and ladders in buys at drawdown tiers.
## When to use
… (sign up to view the full skill)More finance skills
View all Finance skills →Indian Stock Fundamental Analyzer
Give Claude a stock ticker and horizon and get a full clickable fundamental report tuned to the Indian market.
Trend Join Long Strategy Filter
Take the morning gapper list and filter it against a strict five-condition trend-continuation entry template on TradingView through Claude.
Telegram Trade Alert Router
Wire your scanner outputs into a personal Telegram bot so pre-market gappers and strategy hits arrive on your phone all day.
Pine Script Backtest And Python Extender
Ask Claude to write your strategy into TradingView Pine Script for a first backtest, then rewrite it in Python to backtest across your full watchlist.