AGENT SKILL

trading-setup

Configure the trading-skills toolkit - account size, currency, benchmark index, risk limits, data provider (free Yahoo, CSV, or broker), broker (paper or a live broker adapter), credentials and the live-trading switch. Use when the user is getting started, says "set up trading", wants to change risk per trade or limits, connect or log in to a broker, reset the paper account, or when another trading skill reports missing config.

License 许可
MIT
最近更新
2026-11-15
Stars
★ 81
Forks
17

01 前言 Front Matter

name
trading-setup
license
MIT
metadata
{ "pack": "trading-skills", "author": "reddygopalkrishna", "version": "0.2.0" }
description
Configure the trading-skills toolkit - account size, currency, benchmark index, risk limits, data provider (free Yahoo, CSV, or broker), broker (paper or a live broker adapter), credentials and the live-trading switch. Use when the user is getting started, says "set up trading", wants to change risk per trade or limits, connect or log in to a broker, reset the paper account, or when another trading skill reports missing config.

02 资源文件 37

03 SKILL.md 正文

Trading Setup (trading-setup)

One-time (and occasional) configuration for every skill in the pack. All state lives in ~/.trading-skills/ (override with TRADING_SKILLS_HOME). Works with zero API keys: free Yahoo data + the built-in paper broker.

Run commands from this skill's directory. Python 3.9+, standard library only.

Quick start

Ask the user (in one message) for: account size and currency, a benchmark index or ETF for their market, and risk per trade (suggest 0.5-1%). Then:

python3 scripts/setup.py init --equity 100000 --currency USD --benchmark SPY --risk-pct 1
python3 scripts/setup.py doctor

Benchmark examples (Yahoo symbols): SPY / ^GSPC, QQQ, ^FTSE, ^N225, ^NSEI, ^GDAXI, BTC-USD. Exchange suffixes follow Yahoo: .L London, .TO Toronto, .NS NSE, .BO BSE, .T Tokyo, .HK, .AX, .DE.

Commands

Command Purpose
init [--equity --currency --benchmark --provider --broker --risk-pct --exchange --product] create/update config
show [--json] print config (secrets masked)
set KEY VALUE / get KEY edit any dotted key, e.g. set risk.max_daily_loss_pct 2
doctor [--symbol X] check Python, data provider, broker, journal, kill switch
paper-reset [--cash N] wipe the paper account
kite-login --api-key K --api-secret S save Kite credentials, print the login URL
kite-session --request-token T exchange the token for a daily access token
fyers-login --app-id --secret --redirect-uri / fyers-session --auth-code Fyers login (daily)
upstox-login --api-key --api-secret --redirect-uri / upstox-session --code Upstox login (daily)
dhan-login --client-id --access-token save Dhan token (24 h)
groww-login --access-token (or --api-key --api-secret) save Groww token (daily)
live on --i-understand-the-risks / live off enable/disable real orders

Risk keys (config risk.*)

risk_per_trade_pct (1.0), max_position_pct (20), max_open_risk_pct (6), max_open_positions (8), max_daily_loss_pct (3), max_drawdown_pct (15), min_reward_risk (1.5), max_consecutive_losses (3). These are enforced by trading-risk; change them only when the user explicitly asks.

Connecting a live broker (optional)

Live brokers plug in through adapters in core/tradekit/brokers/; the paper broker needs nothing. Adapters available now: Zerodha Kite (below) and beta adapters for Fyers, Upstox, Dhan, Groww (login steps in docs/USAGE.md section 7; Angel One is not supported). If the user's broker has no adapter yet, everything except automatic order placement still works: they place the planned order in their broker's app.

Zerodha Kite

  1. User creates an app at developers.kite.trade. The free Personal plan covers orders, GTT and portfolio. Historical/live data needs the paid Connect plan - otherwise keep data.provider=yahoo.
  2. setup.py init --broker kite --exchange NSE --product CNC
  3. setup.py kite-login --api-key ... --api-secret ... -> user opens the URL and logs in
  4. User pastes the request_token from the redirect URL -> setup.py kite-session --request-token ...
  5. Access tokens expire daily; repeat steps 3-4 each trading day.
  6. Some regulators/brokers require API orders to come from a registered static IP and carry algo identifiers. Tell the user to confirm their broker's API rules before enabling live trading.

Credentials can also come from env vars KITE_API_KEY, KITE_API_SECRET, KITE_ACCESS_TOKEN.

Guardrails

  • Never print, log or echo secrets; show masks them.
  • Never run live on unless the user explicitly asks for live trading in this conversation and understands real money is at risk. Recommend weeks of paper trading first.
  • set refuses broker.live_trading_enabled; use live on|off.

04 同仓库更多 Skills

jiayaoqijia
jiayaoqijia/cryptoskill

troves

Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say "Troves" explicitly.

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

trade

Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say "swap".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

staking

Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say "stake" explicitly.

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

send

Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say "pay 10 STRK to 0x...".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

portfolio

View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks "what do I have", "show me everything", "how much am I worth", "my positions", "my investments", "rebalance my portfolio", "I want 50% ETH", "optimize my holdings", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say "portfolio".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

multi-swap

Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions "two swaps", "three swaps", "swap X and Y at the same time", or wants to convert multiple tokens in a single call.

★ 81