Logo: Alpaca Trading

Alpaca Trading

Communautéit
mickpletcher
alpaca-trading

Work safely in the Trading repository for Alpaca helpers, backtesting, journaling, scheduling, and related PowerShell modules. Prefer additive changes, preserve existing trading logic unless the user asks otherwise, and default to paper-trading-safe guidance.

Iwwersiicht

Editeurmickpletcher
RepositoryAI-Skills
Skill-Nummalpaca-trading
Stären
21
Forks
3
Matgeliwwert Dateien
3
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 3 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    mickpletcher huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Alpaca Trading an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/mickpletcher/AI-Skills/tree/main/claude/skills/alpaca-trading
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mickpletcher/AI-Skills.git /tmp/AI-Skills
mkdir -p .claude/skills
cp -r /tmp/AI-Skills/claude/skills/alpaca-trading .claude/skills/alpaca-trading
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Alpaca Trading an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Alpaca Trading automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Alpaca Trading net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Alpaca Trading

Intent

Support safe paper trading, Alpaca automation, broker workflow analysis, and Trading repo changes without increasing live trading risk.

Do Not Use When

  • Do not use for financial advice, guaranteed performance claims, live order execution without explicit user instruction, or unrelated trading platforms.
  • Required context is missing and cannot be reasonably inferred.
  • A more specific skill in this repo is a better match.

Use this skill when the user is working in the Trading repository on Alpaca-connected scripts, backtesting workflows, journaling, scheduling, or reusable PowerShell Alpaca modules.

Trigger When

  • The user mentions the Trading repo, Alpaca scripts, paper trading, backtesting, journaling, scheduler jobs, or Alpaca PowerShell modules.
  • The task touches Alpaca/, Backtesting/, Journal/, Scheduler/, src/, Tests/, rsi_macd_bot/, or btc-signal-executor/.
  • The user wants to build, extend, debug, document, test, or review repo workflows around Alpaca trading.

Repo Shape

The current repository is a mixed Python and PowerShell project with these main areas:

text
Trading/
|-- Alpaca/
|-- Backtesting/
|-- Journal/
|-- Scheduler/
|-- src/
|-- Tests/
|-- rsi_macd_bot/
`-- btc-signal-executor/

Use the existing structure instead of inventing a new module layout.

Default Behavior

  • Preserve what already exists unless the user asks for a larger redesign.
  • Prefer additive scaffolding over speculative rewrites of trading logic.
  • Default to paper-trading-safe patterns and make live-trading risk explicit.
  • Keep API secrets in environment variables or existing repo config flows, never hardcoded.
  • Align with the repo's existing GitHub Spec workflow for non-trivial changes.

Workflow

  1. Identify which existing repo area the change belongs to.
  2. Read the nearby README, script, or module before proposing changes.
  3. Reuse current patterns for Python, PowerShell, logging, and tests.
  4. For non-trivial work, follow the repo workflow: requirements, spec, plan, tasks, implementation, audit, regression test.
  5. Prefer paper-trading examples unless the user explicitly asks for live-trading support.
  6. If live-trading code is requested, require explicit confirmation patterns and keep the safety guard intact.
  7. Update docs and tests alongside behavior changes.

Safety Rules

  • Default to the Alpaca paper endpoint unless the user explicitly requests live trading.
  • Never remove a live-trading confirmation guard from real-money scripts.
  • Treat AI analysis as advisory only. Do not let model output directly trigger order placement without deterministic code checks.
  • Log trade actions and failures using the repo's existing logging and journal patterns.
  • Call out when a request would move from paper trading into live execution risk.

Implementation Notes

Python And PowerShell

  • The repo is mixed-stack. Do not force everything into one language.
  • Alpaca/ contains existing paper-trading helpers.
  • src/ contains reusable PowerShell Alpaca modules such as auth, config, market data, risk, orders, positions, and account helpers.
  • Tests/ contains Python and PowerShell verification coverage.

Live Trading Guard

If a script can send live orders, include an explicit confirmation gate and make the live path opt-in.

powershell
param(
    [switch]$LiveTrading
)

if ($LiveTrading) {
    $Confirm = Read-Host "Type CONFIRM to proceed with live trading"
    if ($Confirm -ne "CONFIRM") {
        exit 0
    }
}

AI Coaching Pattern

If AI analysis is added, keep it advisory:

  • AI returns a labeled assessment such as BULLISH, BEARISH, or NEUTRAL
  • deterministic code applies risk checks and order rules
  • model output alone must not place an order

Alpaca Capability Profile

Tailor repo advice to how Alpaca actually behaves rather than generic broker assumptions:

  • Paper and live use the same API shape but different endpoints; paper fills are simulated and optimistic, so backtest and paper results overstate live fill quality, especially for market orders in thin symbols.
  • Fractional shares trade market-only and have order type restrictions; do not propose fractional limit logic.
  • Bracket and OCO orders are supported but legs cannot be amended freely; cancel and replace is the realistic pattern.
  • Crypto trading has different fee, precision, and minimum rules than equities; do not reuse equity assumptions in btc-signal-executor/.
  • Equity market data on the free tier is IEX-only and delayed for some uses; flag when a strategy assumes SIP-quality data the account may not have.
  • PDT rules apply to margin equity accounts under $25k; day trading logic should check account status instead of assuming.

When a proposal depends on an Alpaca behavior not listed here, verify it against current Alpaca docs instead of assuming.

Order Lifecycle Checklist

Before proposing or reviewing a change that touches order placement, walk the full lifecycle:

  • Entry: validated symbol, side, quantity, and order type; idempotency or duplicate-submit protection; behavior when the market is closed
  • Open order: what happens to unfilled limit orders at end of day; time-in-force is explicit, not defaulted silently
  • Partial fills: position sizing, journaling, and exit logic handle a partially filled entry without double-ordering
  • Exits: stop and target exist before or at entry (bracket or managed); exit logic survives a restart with positions already open
  • Cancel/replace: replaces are atomic from the strategy's view; stale order IDs are not reused
  • Failure paths: rejected orders, API errors, and timeouts are logged to the journal and do not leave untracked positions

A change is incomplete if it improves one lifecycle stage and silently breaks another.

Regression Test Matrix

Map the kind of change to the test passes that must run before it ships:

Change touchesRun
src/ PowerShell modulesPester tests in Tests/, plus a paper-endpoint smoke call for the touched module
Alpaca/ helpersPython tests in Tests/, paper-endpoint smoke test
Order or risk logic anywhereFull Tests/ suite plus a paper trade round trip: place, verify, cancel
Backtesting/Backtest determinism check: same data in, same results out, before and after
Scheduler/Dry-run the scheduled job manually and verify journal output
rsi_macd_bot/ or btc-signal-executor/That bot's own tests plus a paper session observed end to end

If a needed test does not exist, write it as part of the change rather than noting it as a gap.

Constraints

  • Do not invent folders like PaperTrading, LiveTrading, TradeJournal, or AICoaching if the work belongs in the current repo structure.
  • Do not hardcode credentials.
  • Do not rewrite business logic just to modernize style.
  • Do not describe the repo as a Claude-only system; it is a general trading repo with Claude-relevant integrations.

References

  • Root repo guide: Trading/README.md
  • GitHub Spec baseline: Trading/specs/001-core-trading-foundation/
  • Copilot instructions already present in the repo: Trading/.github/copilot-instructions.md

Validation Checklist

  • Repo area matches the real Trading repository layout
  • Paper trading is the default path in examples and guidance
  • Live trading remains explicit and guarded
  • Secrets are sourced from environment variables or existing config flows
  • Changes preserve existing trading logic unless requested otherwise
  • Docs and tests are updated when behavior changes

Help And Examples

If the user is not sure how to use this skill, asks what it needs, or asks for examples:

  • Explain in plain language what this skill can do.
  • Tell the user the minimum input needed for a useful first pass.
  • Show the example prompts below.
  • Offer the fastest next prompt the user can send.

Minimum useful input:

  • A trading goal, repo context, or strategy question plus any symbols, timeframes, or risk rules that matter.

Example prompts:

  • Use alpaca-trading to review my Trading repo and tell me the safest way to add bracket orders.
  • Help me build an Alpaca paper trading workflow for SPY with clear entry, exit, and risk rules.
  • Show me how to use this skill for a repo level trading automation plan.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Alpaca Trading?

Work safely in the Trading repository for Alpaca helpers, backtesting, journaling, scheduling, and related PowerShell modules. Prefer additive changes, preserve existing trading logic unless the user asks otherwise, and default to paper-trading-safe guidance.

Firwat Alpaca Trading op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Alpaca Trading besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Alpaca Trading an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/mickpletcher/AI-Skills/tree/main/claude/skills/alpaca-trading an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Alpaca Trading benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Alpaca Trading benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Alpaca Trading domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Alpaca Trading gratis?

Jo. mickpletcher huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇