ptrade-dev

ptrade-dev is a skill for Claude Code from kay-ou/ClaudeSkills. It costs 126 tokens per session (3,139 once invoked), scanned A, original, MIT.

A coding guide for PTrade and SimTradeLab, platforms used to write and test quantitative trading strategies.

In plain words
What is it for?
Use it when writing, editing, or reviewing PTrade strategies and SimTradeLab backtests.
Why use it?
It helps avoid platform-specific syntax and API mistakes that could make a strategy fail or behave incorrectly.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it when writing, editing, or reviewing PTrade strategies and SimTradeLab backtests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kay-ou/claudeskills/ptrade-dev
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add kay-ou/ClaudeSkills --skill ptrade-dev
Clone the repo
git clone --depth 1 https://github.com/kay-ou/ClaudeSkills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ptrade-dev

README.md
[![agentmods](https://agentmods.dev/badge/skills/kay-ou/claudeskills/ptrade-dev/github.svg)](https://agentmods.dev/skills/kay-ou/claudeskills/ptrade-dev)
Your own site
<a href="https://agentmods.dev/skills/kay-ou/claudeskills/ptrade-dev"><img src="https://agentmods.dev/badge/skills/kay-ou/claudeskills/ptrade-dev/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ptrade-dev

Your own site · 80×15
<a href="https://agentmods.dev/skills/kay-ou/claudeskills/ptrade-dev"><img src="https://agentmods.dev/badge/skills/kay-ou/claudeskills/ptrade-dev.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 126 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,139 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00126 $0.03139
Opus 5.5 $0.00050 $0.01256
Sonnet 5.5 $0.00025 $0.00628
Haiku 4.5 $0.00013 $0.00314

Measured 1mo ago against content hash b396932247f6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ptrade-dev scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/ptrade-dev/SKILL.md · 305 lines

How it starts

The opening of the file, as written. The whole thing — 305 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PTrade Strategy Development Skill

You are writing code for the PTrade quantitative trading platform or its local simulator SimTradeLab. This skill ensures you NEVER make API errors by providing the complete reference inline.

CRITICAL PLATFORM CONSTRAINTS

These constraints apply to ALL code that runs on PTrade (NOT local-only files like research/run_local_backtest.py):

  1. NO f-strings — Use % formatting or .format(). PTrade's Python does not support f-strings.

    # WRONG
    log.info(f"price: {price}")
    # CORRECT
    log.info("price: %s" % price)
    log.info("price: {}".format(price))
    
  2. NO import io or import sys — These modules are blocked on PTrade.

  3. NO walrus operator := — Not supported.

  4. NO match/case — Not supported.

  5. Code format: PTrade uses .SS (Shanghai) and .SZ (Shenzhen) suffixes, but Order objects return .XSHG / .XSHE suffixes. Be aware of this difference.

  6. Global object g: Use g.xxx for cross-function state. Variables starting with __ are private and won't be persisted.

  7. log object: Use log.info(), log.warning(), log.error() etc. Never print().

STRATEGY LIFECYCLE (MANDATORY KNOWLEDGE)

A strategy has exactly 2 required functions and 5 optional ones:

initialize(context)          # REQUIRED — runs once at startup
handle_data(context, data)   # REQUIRED — runs every bar (daily/minute)
before_trading_start(context, data)  # optional — runs before market open
after_trading_end(context, data)     # optional — runs after market close
tick_data(context, data)     # optional — runs every 3s (live trading only)
on_order_response(context, order_list)  # optional — order callback (live only)
on_trade_response(context, trade_list)  # optional — trade callback (live only)

Lifecycle Timing

  • initialize: runs ONCE at strategy start
  • before_trading_start: backtest 8:30, live 9:10 (configurable)
  • handle_data: backtest 9:31-15:00 (minute) or 15:00 (daily); live 9:30-14:59
  • after_trading_end: ~15:30
  • tick_data: 9:30-14:59, every 3s (live only)

Read the full file on GitHub · 305 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 305 lines · 126 tokens per session scan A b396932247f6

Subscribe to this mod's changes

ptrade-dev is a skill published in the GitHub repository kay-ou/ClaudeSkills (10 stars, last pushed 6mo ago), licensed MIT. It adds 126 tokens to every session and 3,139 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

invoice-organizer

Automatically organizes invoices and receipts for tax preparation by reading messy files, extracting key information, renaming them consistently, and sorting them into logical folders. Turns hours of manual bookkeeping into minutes of automated organization.

Prat011/awesome-llm-skills · 44 tokens

ma-playbook

M&A strategy for acquiring companies or being acquired. Due diligence, valuation, integration, and deal structure. Use when evaluating acquisitions, preparing for acquisition, M&A due diligence, integration planning, or deal negotiation.

alirezarezvani/claude-skills · 46 tokens

financial-statement-analysis

Reads a set of financial statements and establishes what changed and why — fluctuation analysis against prior period and against budget, profitability, liquidity, solvency and efficiency ratios, benchmarking, and the non-GAAP measures presented alongside them. Use this to interpret results, review a counterparty's or…

cbrock84/headcount · 93 tokens

agent-era-pricing

Redesign seat-based pricing for the agent era — when one human runs ten agents, per-seat models collapse. Use when agents are eroding seat counts, when asked to migrate to usage- or outcome-based pricing, to price an agent/API tier, or to defend revenue as customers automate their own usage. Produces a pricing…

mohitagw15856/pm-claude-skills · 108 tokens

collections-email

Write a polite-but-firm payment-reminder / collections email sequence for overdue invoices. Use when asked to write a collections email, a payment reminder, a dunning sequence, or to chase an overdue invoice. Produces a staged sequence — gentle pre-due nudge through escalating overdue reminders to a final notice …

mohitagw15856/pm-claude-skills · 84 tokens

financial-statement-explainer

Explain a financial statement (P&L, balance sheet, or cash flow) in plain English. Use when asked to explain a P&L / income statement, a balance sheet, a cash flow statement, or to make financials understandable to a non-finance reader. Produces a plain-language walkthrough — what each section means, the line items…

mohitagw15856/pm-claude-skills · 107 tokens