Trader Budget
Budget Manager.
Install
npx skills add Jakeschincariol/trader-skill --skill trader-budget -g -a claude-code -y- Repository
- Jakeschincariol/trader-skill1.1k
- Category
- Engineering
- Updated
- 21d ago
- License
- MIT
- Context cost
- Lightabout 1,216 tokens
- Runs scripts
- Yes, review before use
What it does
Budget Manager. Sizes every position to your budget before anything is bought: keeps a cash buffer, caps any one stock (the excess is shared out to the others), drops slices under your minimum order, rounds so every dollar is used, supports fractional or whole shares, and writes the proposed buy orders to trader/orders.json in the exact shape of Alpaca's place_stock_order (notional as a string). Nothing is placed. Use when the user says "I have $5,000", "size my trades", "how much of each should I buy", "manage my budget", "split my money", "keep 10% in cash", "no stock over 25%", "set my rules", or after /trader-copycat writes targets.
trader-budget
The Budget Manager turns "copy this portfolio" into "buy exactly this much of each", inside rules the user sets once. It writes proposals only. trader-risk checks them and trader-broker asks the user yes or no for each one.
${CLAUDE_SKILL_DIR} below is this skill's folder (where this SKILL.md lives).
python3 "${CLAUDE_SKILL_DIR}/size.py" # trader/targets.json + trader/config.json
python3 "${CLAUDE_SKILL_DIR}/size.py" --budget 5000 --write # write trader/orders.json
python3 "${CLAUDE_SKILL_DIR}/size.py" --whole-shares --prices trader/prices.json
python3 "${CLAUDE_SKILL_DIR}/size.py" --weights AAPL=22.04,AXP=17.14,GOOGL=12.62 --json
What it reads and writes
| file | what |
|---|---|
trader/config.json | the rules (start from config.example.json in this folder) |
trader/targets.json | the weights to copy, written by trader-copycat (targets.example.json here) |
trader/prices.json | only for whole shares or share counts (trader-alerts writes it) |
trader/orders.json | the proposed buy orders it writes with --write |
Step 1: set the rules once
If trader/config.json does not exist, copy config.example.json into
trader/config.json and ask the user for each value in plain words:
- budget: how much money this is for. Only money they can afford to lose.
- cash_buffer_pct: how much stays in cash (default 10).
- max_position_pct: the most any one stock may be, as a percent of the budget (default 25).
- max_order_usd and min_order_usd: the biggest and smallest single order (2000 and 5).
- fractional: true if the broker buys fractional shares (Alpaca does); false for whole shares.
- blocked: tickers they never want to own.
- Keep paper true until they have watched it work on a paper account.
Step 2: size it
python3 "${CLAUDE_SKILL_DIR}/size.py" --write
