Skip to content

Guide · Agent skill

How to use the Trade Execution Modeling agent skill (execution-model)

Updated · written with AI from the project's own documentation and checked against our catalogue data

The execution-model skill gives an AI agent guidance and tested Python helpers for making trading backtests more realistic. Instead of assuming every trade fills at the closing price with no cost, the agent can add slippage, market-impact costs for large orders, execution delay and typical commission and stamp-duty figures. This guide explains what the skill does, how to install it, how to ask for it in plain language, and what to watch out for. It is for backtest simulation only and does not place live orders.

Trade Execution ModelingHKUDS/Vibe-Trading · MIT

Quick start

  1. 1Get the skill. Download the ZIP from this page.
  2. 2Install the folder. Unzip into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. Alternatively upload it under Settings → Capabilities → Skills in the Claude apps.
  3. 3Make the impact module available. Ensure the Vibe-Trading repository's src/quantlib/impact.py is importable from your Python project, since the skill's code imports from it.
  4. 4Describe your backtest. Tell the agent the instrument, market, strategy and typical order size relative to daily volume.
  5. 5Ask for realistic execution. Request slippage, market impact, delay or costs in plain language, naming the model if you know it.
  6. 6Check the assumptions. Review the chosen slippage, impact and commission values against your own data before trusting results.

What the execution-model skill makes the agent do

An agent skill is a folder with a SKILL.md file that tells an AI agent how to handle a certain kind of task. When this skill is active, the agent uses execution assumptions in backtests instead of idealised fills. The skill covers four areas: slippage models (fixed, linear and square-root impact), VWAP and TWAP execution principles, a transaction-cost breakdown, and execution-assumption settings such as trade delay.

The skill points the agent to functions in src/quantlib/impact.py in the Vibe-Trading repository, which the source says are implemented and tested. The agent should import these rather than retype the formulas.

  • Fixed slippage: fixed_slippage(), with bps defaulting to 5.0
  • Linear impact: linear_impact(), impact = impact_coeff × volume_traded / adv
  • Square-root impact: sqrt_impact(), impact = η × σ × sqrt(volume_traded / adv)
  • Execution delay: delayed_execution(), where delay_bars=1 means trade on the next bar (T+1)
from src.quantlib.impact import fixed_slippage, linear_impact, sqrt_impact, delayed_execution

Install the skill (ZIP download or Claude apps upload)

Option 1: download the ZIP from this page and unzip it into your personal skills folder, ~/.claude/skills/, or into a project's .claude/skills/ folder so that only that project uses it.

Option 2: in the Claude apps, open Settings, go to Capabilities, then Skills, and upload the skill there.

The skill's only file is SKILL.md. The code examples import from the Vibe-Trading repository, so you also need that repository's src/quantlib/impact.py module available to your Python project.

  • Personal install: ~/.claude/skills/
  • Project install: .claude/skills/ inside your project
  • App install: Settings → Capabilities → Skills

Trigger the skill with natural requests

You do not need to name the skill. Ask for the thing it handles, and mention backtests and costs so the agent knows the context. Be specific about the instrument, the market and the order size, because the skill's advice depends on liquidity.

Good requests describe a backtest you already have or want to build, for example asking the agent to rerun a strategy with realistic costs or to check whether returns survive slippage.

  • "Rerun my momentum backtest on CSI 300 stocks with realistic slippage and T+1 execution."
  • "My strategy trades about 20% of daily volume in small caps. Which impact model should I use?"
  • "Add a square-root market impact cost to this BTC-USDT backtest."
  • "What commission and stamp duty should I assume for A-share sell orders?"

Examples of how the agent applies the skill

Fixed slippage on a buy and a sell: at price 100 with bps=5, a buy fills at 100.05 and a sell at 99.95.

Linear impact: trading 100k shares against 1M average daily volume is 10% participation. At impact_coeff 0.1 that is a 1% move, so the buy price becomes 101.0.

Square-root impact: trading 250k against 1M ADV with daily volatility 0.02 and eta 0.5 gives 50 bps of impact, so the buy price is about 100.5.

Execution delay: delayed_execution(raw_signal, delay_bars=1) trades tomorrow on today's signal, matching the China A-share T+1 rule.

fixed_slippage(price=100.0, direction=1, bps=5.0) # 100.05 linear_impact(price=100.0, direction=1, volume_traded=100_000, adv=1_000_000, impact_coeff=0.1) # 101.0 sqrt_impact(price=100.0, direction=1, volume_traded=250_000, adv=1_000_000, volatility=0.02, eta=0.5) # 100.5

Choose a slippage model by trade size

The skill suggests choosing the model from the size of your backtest capital relative to the instrument's average daily volume (ADV). Small trades can use a fixed assumption, medium trades a linear model, and large trades the square-root model, which the skill marks as required above 5% of ADV.

  • Capital under 0.5% of ADV: fixed slippage (5 bps) is enough
  • Capital 0.5% to 5% of ADV: linear impact model
  • Capital over 5% of ADV: square-root impact model (required)

Set costs and execution assumptions in config

The skill's reference table suggests a one-way commission of 0.001 (0.1%) as a conservative all-in figure for China A-shares and crypto, and 0.001 to 0.002 for Hong Kong and US equities. Note that the 0.1% figure in the source is described as already including stamp duty and spread.

Backtest config examples in the source use a commission value, an engine of daily and an interval of 1D. The SignalEngine example sets execution_delay to 1, slippage_bps to 5 and max_participation to 0.05.

  • China A-shares: commission 0.001, with T+1 delay (delay_bars=1)
  • Crypto: commission 0.001 including slippage, delay_bars 0 or 1
  • Hong Kong / US equities: commission 0.001 to 0.002
{ "commission": 0.001, "engine": "daily", "interval": "1D" }

Safety notes: scripts, network and live trading

This skill runs scripts and its code examples depend on the Vibe-Trading repository's impact.py module. It does not use the network, according to its listing. It is for backtest simulation only: it does not connect to a broker or exchange and does not place orders.

The reference numbers (slippage in bps, impact coefficients, commissions and spreads) are rough suggestions, not calibrated for any specific stock or coin. Do not treat them as facts about a particular instrument, and do not use them as investment advice.

  • Runs scripts: yes (depends on src/quantlib/impact.py)
  • Uses network: no
  • No live order execution; do not rely on it for real trading decisions without your own calibration

What people use it for

  • Checking whether a trading strategy's backtest returns still look good after slippage and commissions
  • Choosing between fixed, linear and square-root impact models based on order size relative to ADV
  • Simulating T+1 execution for China A-share strategies using delayed_execution
  • Estimating how much market impact a large crypto order would add in a backtest
  • Teaching students how transaction costs and market impact reduce strategy returns

Frequently asked questions

How do I install the execution-model skill?

Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder. In the Claude apps you can instead upload it under Settings → Capabilities → Skills.

What does the execution-model skill require?

It requires a Python environment and the src/quantlib/impact.py module from the Vibe-Trading repository, which the code examples import. The skill's listing says it runs scripts and does not use the network.

Is the execution-model skill free and what is its licence?

The listing states the licence is MIT. The source does not give pricing, so check the repository for any terms beyond the licence.

Can this skill place live trades or connect to my broker?

No. The skill covers backtest simulation only and does not involve live order execution or any broker or exchange connection.

Are the slippage and commission numbers accurate for my stock or coin?

They are rough reference suggestions, not calibrated for any particular instrument. Calibrate them with your own data before relying on them.

What is the difference between linear and square-root impact?

The linear model assumes constant marginal impact, which can overstate the cost of very large orders. The square-root model has marginal impact that declines for larger orders and is the one the skill marks as required when capital exceeds 5% of ADV.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if you are a quant researcher, developer or student who wants backtests to account for slippage, market impact, delay and trading costs using tested helper functions. Pick something else if you need live order execution, broker connectivity, or calibrated per-stock cost estimates, since this skill covers backtest simulation only and its reference numbers are rough.

Download the skill