Skill instructions
backtest-a-strategy3.29 KB
View saved version →
---
name: backtest-a-strategy
description: Turn an investing or trading strategy the user describes in plain English into explicit Shadowfolio rules, ask for any missing specifics (what to trade, when to buy, when to sell, how often to rebalance, how to size positions), backtest it over the last 12 months against a benchmark, and offer to save it for daily forward tracking. Use when the user wants to test, backtest, paper-trade or track a strategy of their own. Not for picking investments.
---
Use this skill when the user describes a strategy of their own and wants to know how it would have done, or wants to track it from today. The user's explicit instructions always come first.
## Inputs
The strategy in the user's words. The `strategy` fields of the Shadowfolio tools hold what the user said:
- **What to trade:** their tickers (`universe.symbols`, up to 50), `universe.preset` `sp500` (optionally one `sector`) or `popular_etfs`.
- **When to buy:** `entry` rules, all of which must hold: price against an N-day average, a fast and a slow average, RSI, return over N days, distance from an N-day high. A rule can look at another ticker with `symbol`, for example "only while SPY is above its 200-day average". `rank` chooses among many ("the 5 with the best 6-month return": `rank` by `return`, 126 days, `highest`, `max_positions` 5).
- **When to sell:** `exit` rules (any one sells), `stop_loss_pct`, `take_profit_pct`, `max_hold_days`. An empty `exit` list means "sell what no longer qualifies at the next rebalance".
- **How often:** `rebalance` daily, weekly, monthly or quarterly.
- **How to size:** `sizing` equal, inverse_volatility or fixed_weights (with `weights` in percent), and `max_positions`.
- Optional: `cash_symbol` (where idle money sits), `benchmark` (SPY unless named), `cost_bps`.
Months are 21 trading days (3 months = 63, 6 months = 126, 1 year = 252).
## Flow
1. When any of the five specifics is missing, `draft_strategy` takes what the user said and returns the open questions, each with its default, short enough to ask in one message. Tickers, numbers and rules come from the user, or from those defaults.
2. Once the user answers, or accepts the defaults, `run_backtest` takes the rules (the `rules` from `draft_strategy`, updated with the answers).
3. The result ends with a summary suitable to show the user: return, benchmark return, max drawdown, Sharpe ratio, trades and win rate, and that the results are hypothetical.
4. When the user wants to keep it, `save_strategy` takes the same rules. Shadowfolio tracks it daily from the latest close.
5. Later, `list_my_strategies` shows how each saved strategy is doing, and `show_strategy` shows one in detail. `create_share_link` makes a public link when the user asks for one.
## Scope
- Shadowfolio doesn't recommend, pick or rank securities, funds or strategies, and its results don't say whether a strategy is good, will work or should be followed.
- Backtest and tracking figures come from the tools' results, computed on stored daily closes.
- Shadowfolio can't trade, connect to a broker or move money.
- A tool result with a `problem` (an unknown ticker, prices still loading) has a sentence for the user that says what happened.
- A question about what to buy is investment advice, which Shadowfolio doesn't give; it can test a rule the user describes.
Referenced files: 2 — file references are metadata, not package contents.
market-myth-test2.31 KB
View saved version →
---
name: market-myth-test
description: Check a common market rule of thumb, such as a golden cross, buying a dip from the high, an RSI oversold signal or a 200-day moving average filter, against buy-and-hold over the last 12 months with Shadowfolio. Use when the user asks whether a well-known trading rule or market saying would have worked.
---
Use this skill when the user asks whether a familiar rule beat simply holding: "did a golden cross on QQQ beat buy-and-hold this year?", "does buying SPY after a 5% dip from its high work?", "is RSI under 30 a good buy signal for AAPL?". The user's explicit instructions always come first.
## Turning the saying into rules
The rule types Shadowfolio can test, each optionally on another ticker with `symbol`:
- **Moving-average filter:** price above or below its N-day average (`price_vs_sma`), for example 200 days.
- **Golden or death cross:** a fast average above or below a slow one (`sma_cross`), for example 50 and 200 days.
- **RSI level:** RSI over N days above or below a value (`rsi`), for example 14 days below 30.
- **Momentum:** the return over N days above or below a percent (`return`).
- **Dip from the high:** the distance from the N-day high above or below a percent (`pct_from_high`), for example more than 5% under the 252-day high.
Months are 21 trading days (3 months = 63, 1 year = 252). Calendar sayings such as "sell in May" have no matching rule type.
## Flow
1. `draft_strategy` takes the saying in the user's words, maps it onto these rules and returns any open questions (what to trade, when to sell, how often to check) with their defaults.
2. `run_backtest` tests the settled rules over the last 12 months of daily closes against a benchmark, SPY unless the user names one; naming the traded ticker itself (QQQ for a QQQ rule) makes it a buy-and-hold comparison. The result gives the strategy's return next to the benchmark's, max drawdown, Sharpe ratio, trades and win rate.
3. One year is a short window, and the summary says the results are hypothetical. A user who wants to keep watching the rule can save it (see the strategy tracking skill).
## Scope
- Shadowfolio tests the rule the user describes; it doesn't say whether a rule is good or should be followed, and it doesn't pick securities.
- Daily closes of US stocks and ETFs only; no intraday data, no other markets.
Referenced files: 2 — file references are metadata, not package contents.
test-a-strategy3.28 KB
View saved version →
---
name: test-a-strategy
description: Turn an investing or trading strategy the user describes in plain English into explicit Shadowfolio rules, ask for any missing specifics (what to trade, when to buy, when to sell, how often to rebalance, how to size positions), backtest it over the last 12 months against a benchmark, and offer to save it for daily forward tracking. Use when the user wants to test, backtest, paper-trade or track a strategy of their own. Not for picking investments.
---
Use this skill when the user describes a strategy of their own and wants to know how it would have done, or wants to track it from today. The user's explicit instructions always come first.
## Inputs
The strategy in the user's words. The `strategy` fields of the Shadowfolio tools hold what the user said:
- **What to trade:** their tickers (`universe.symbols`, up to 50), `universe.preset` `sp500` (optionally one `sector`) or `popular_etfs`.
- **When to buy:** `entry` rules, all of which must hold: price against an N-day average, a fast and a slow average, RSI, return over N days, distance from an N-day high. A rule can look at another ticker with `symbol`, for example "only while SPY is above its 200-day average". `rank` chooses among many ("the 5 with the best 6-month return": `rank` by `return`, 126 days, `highest`, `max_positions` 5).
- **When to sell:** `exit` rules (any one sells), `stop_loss_pct`, `take_profit_pct`, `max_hold_days`. An empty `exit` list means "sell what no longer qualifies at the next rebalance".
- **How often:** `rebalance` daily, weekly, monthly or quarterly.
- **How to size:** `sizing` equal, inverse_volatility or fixed_weights (with `weights` in percent), and `max_positions`.
- Optional: `cash_symbol` (where idle money sits), `benchmark` (SPY unless named), `cost_bps`.
Months are 21 trading days (3 months = 63, 6 months = 126, 1 year = 252).
## Flow
1. When any of the five specifics is missing, `draft_strategy` takes what the user said and returns the open questions, each with its default, short enough to ask in one message. Tickers, numbers and rules come from the user, or from those defaults.
2. Once the user answers, or accepts the defaults, `run_backtest` takes the rules (the `rules` from `draft_strategy`, updated with the answers).
3. The result ends with a summary suitable to show the user: return, benchmark return, max drawdown, Sharpe ratio, trades and win rate, and that the results are hypothetical.
4. When the user wants to keep it, `save_strategy` takes the same rules. Shadowfolio tracks it daily from the latest close.
5. Later, `list_my_strategies` shows how each saved strategy is doing, and `show_strategy` shows one in detail. `create_share_link` makes a public link when the user asks for one.
## Scope
- Shadowfolio doesn't recommend, pick or rank securities, funds or strategies, and its results don't say whether a strategy is good, will work or should be followed.
- Backtest and tracking figures come from the tools' results, computed on stored daily closes.
- Shadowfolio can't trade, connect to a broker or move money.
- A tool result with a `problem` (an unknown ticker, prices still loading) has a sentence for the user that says what happened.
- A question about what to buy is investment advice, which Shadowfolio doesn't give; it can test a rule the user describes.
Referenced files: 1 — file references are metadata, not package contents.
track-a-strategy1.79 KB
View saved version →
---
name: track-a-strategy
description: Save a backtested strategy and follow it as a hypothetical shadow portfolio updated after every US market close, list saved strategies, show one, share its record or delete it. Use when the user wants to paper-trade, forward-test or check on a strategy they saved with Shadowfolio.
---
Use this skill when the user wants to keep a strategy going from today, or comes back to ask how a saved strategy is doing. The user's explicit instructions always come first.
## Flow
1. `save_strategy` takes the same rules that were backtested and starts a hypothetical 10,000 shadow portfolio from the latest close. It is kept under the user's anonymous ChatGPT ID; there is no account.
2. After every US market close the portfolio is updated from that day's closing prices.
3. `list_my_strategies` lists each saved strategy with its number, name and return since it was saved, next to its benchmark over the same days.
4. `show_strategy` shows one strategy by number or name: its forward-tracking record since saving (return, max drawdown, benchmark), its current simulated holdings and recent simulated trades, and the backtest from when it was saved.
5. `create_share_link` creates, or returns the existing, public link to a page with that strategy's rules and hypothetical record, when the user asks to share it.
6. `delete_strategy` stops tracking one strategy and deletes its record and share link; `delete_my_data` deletes everything of this user. Both are permanent.
## Scope
- Every figure is hypothetical: no real money, no broker connection and no trades are involved.
- Shadowfolio doesn't say whether a strategy is good or should be followed, and doesn't suggest changes on its own.
- Each result ends with a summary suitable to show the user; the card shows the chart and holdings.
Referenced files: 2 — file references are metadata, not package contents.