Logo Alpaca Trading

Alpaca Trading

Cộng đồng
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.

Tổng quan

Nhà phát hànhmickpletcher
Kho mãAI-Skills
Tên kỹ năngalpaca-trading
Sao
21
Bản fork
3
Tệp đi kèm
3
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 3 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được mickpletcher công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Alpaca Trading trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/mickpletcher/AI-Skills/tree/main/claude/skills/alpaca-trading
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Alpaca Trading trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Alpaca Trading ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Alpaca Trading với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Alpaca Trading làm được gì?

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.

Vì sao nên dùng Alpaca Trading trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Alpaca Trading là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Alpaca Trading trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/mickpletcher/AI-Skills/tree/main/claude/skills/alpaca-trading. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Alpaca Trading?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Alpaca Trading với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Alpaca Trading với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Alpaca Trading có miễn phí không?

Có. Kỹ năng này được mickpletcher phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇