safe_trading

Filter stock trading pools into compliant sellable and buyable sets using Alpaca market calendar data.

2|4|Updated Apr 27, 2026
One-click install
npx skills add https://github.com/khoks/ClaudeTrading --skill safe-trading
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: safe_trading
Source: https://github.com/khoks/ClaudeTrading/tree/main/.claude/skills/safe_trading
Command: npx skills add https://github.com/khoks/ClaudeTrading --skill safe-trading

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, and includes scripts (resource) components.

What problem does it solve?

Autonomous trading systems and active traders risk violating FINRA pattern day trader (PDT) rules and IRS H1B visa income classification requirements if they execute buy and sell transactions too close together, and manually tracking mandatory cooldown periods between trades is error-prone and time-consuming.

Core Features & Use Cases

  • 2-Trading-Day Cooldown Enforcement: Automatically enforces a configurable cooldown period between buy and sell actions, using trading days (excluding weekends and holidays) rather than calendar days to avoid loopholes.
  • Automatic Pool Filtering: Splits the user's stock trading pool into two compliant sets: sellable (positions held for at least 2 trading days) and buyable (stocks not sold in the last 2 trading days or never sold).
  • Use Case: For ClaudeTrading and similar autonomous trading systems, this skill acts as a mandatory safety gate that all trade orders must pass through before execution, ensuring regulatory compliance without manual oversight.

Quick Start

Use the safe_trading skill to retrieve the current list of compliant sellable and buyable stocks from your trading pool.

Frequently Asked Questions about safe_trading

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce FINRA pattern day trader cooldown rules in an automated stock trading system?

To avoid pattern day trader violations, filter your stock pool into compliant sellable and buyable sets by enforcing a 2-trading-day cooldown between buy and sell actions. This skill calculates that threshold using Alpaca market calendar data to exclude weekends and holidays.

How does the 2-trading-day cooldown calculation handle weekends and market holidays?

The 2-trading-day cooldown uses Alpaca market calendar data to count only active trading days, excluding weekends and holidays. This prevents calendar-day loopholes and accurately reflects actual market sessions before clearing stocks as sellable.

Can I use this stock-filtering tool with my Alpaca paper trading account?

Yes, this stock-filtering tool integrates directly with Alpaca paper trading accounts. It retrieves market calendar data to calculate mandatory cooldown periods and splits your trading pool into compliant buyable and sellable sets for autonomous trading.

What is the best way to avoid H1B visa income classification misclassification from trading?

To avoid H1B visa income classification misclassification, enforce mandatory cooldown periods between buy and sell transactions to prevent excessive day trading. This skill filters stocks into compliant sets, ensuring trading frequency stays within regulatory limits.

How does the cooldown filter handle edge cases like empty pools or future-dated timestamps?

The cooldown filter explicitly handles edge cases including empty stock pools, future-dated timestamps, and newly added pool entries. This ensures the filtering logic remains stable and does not crash when evaluating non-standard or incomplete trading data.

Do I need jq installed to run the safe_trading stock filter?

Yes, you need jq installed as a dependency to run the safe_trading stock filter. The scripts use jq to process and parse JSON trading pool data when splitting stocks into compliant buyable and sellable sets.