- Home
- Skills
- Trading & Investing
- Aurelion
Works with the AI Agents you already use
Aurelion
Turns a plain-English trading hypothesis into a backtested strategy with Sharpe/drawdown risk metrics, a skeptical critique, and a complete Markdown report.
Free
Aurelion
Example session with this skill installed
/aurelion research and backtest the AAPL stock during covid.
- Read your context and instructions
- Compiled the aurelion
Wrote aurelion-work\report.md
Quantitative Research Report
Objective: Research and backtest AAPL during the COVID-19 crash and recovery (2020-01-01 → 2021-06-30), long/short scope, $100,000 capital.
Tickers: AAPL · Period: 2020-01-01 → 2021-06-30 · Data source: yfinance
Data note: data was fetched from 2018-06-01 to warm up SMA_200 (200 trading days), then trimmed to the agreed window, so all 376 rows (2020-01-02 → 2021-06-29) carry fully warmed indicators while the backtest period remains exactly as specified.
Hypothesis
Statement: AAPL during COVID showed two distinct regimes — a sharp crash regime (Feb 19 → Mar 23, 2020, ≈ −33%) and a dominant uptrend regime (Apr 2020 → Jun 2021). A momentum-regime strategy — long by default, short when 20-day momentum collapses below −10% — should capture the crash on the short side and the recovery on the long side, beating buy-and-hold on a risk-adjusted basis.
Signals/factors tested: returns_20d (primary regime switch); SMA_20/SMA_50, rsi_14 available as confirmation (not required by the final rule).
Entry/exit logic: signal 1 = long (momentum healthy), -1 = short (crash momentum, returns_20d < −0.10), 0 = neutral only when returns_20d is unavailable. Because the backtester maps -1 to both long-exit and short-entry, the strategy alternates long ↔ short and cannot hold cash after the first signal.
- Scope: single ticker AAPL, long/short, $100,000 initial capital, daily frequency.
Strategy Code
def generate_signals(df):
# COVID regime switch: long by default; short while 20-day momentum
# collapses below -10% (the crash window), then back to long.
sig = pd.Series(1, index=df.index, dtype=int)
sig[df["returns_20d"] < -0.10] = -1
sig[df["returns_20d"].isna()] = 0
return sig
Backtest Results
| Metric | Value |
|---|---|
| Avg Return | 48.45% |
| Avg Sharpe | 1.04 |
| Avg Max Drawdown | -26.62% |
| Total Return | 48.45% |
Per ticker
| Ticker | Return | Sharpe | Max DD | Win Rate | Trades |
|---|---|---|---|---|---|
| AAPL | 48.45% | 1.04 | -26.62% | 25.0% | 17 |
Benchmark — AAPL buy-and-hold, same window: +83.71% return, −31.43% max drawdown, Sharpe ≈ 1.19 (rf = 0). Final portfolio value: $148,447 of $100,000.
Risk Assessment
| Metric | Value |
|---|---|
| Calmar Ratio | 1.82 |
| Risk Flag | Acceptable risk-adjusted returns |
| Drawdown Flag | Warning - drawdown exceeds 15% |
| VaR 95% (daily) | -0.0351 |
| CVaR 95% (daily) | -0.059 |
| Sortino | 1.6547 |
| Annualized Vol | 0.4145 |
Despite the "acceptable" Sharpe label, the strategy's 1.04 Sharpe is below buy-and-hold's ≈ 1.19 over the same window, and the −26.62% drawdown means a $26,600 peak-to-trough loss on a $100,000 account — only marginally shallower than doing nothing (−31.43%). Returns come from a minority of trades (25% win rate over 17 trades) and tail risk is fat (daily CVaR −5.9% vs VaR −3.5%), so the edge is concentrated, fragile, and not sufficient compensation for the drawdown taken. Note also that VaR/CVaR/Sortino/vol are computed from AAPL's own daily returns (asset-level), not the strategy's PnL — they describe the underlying risk, not the account.
Critique
Severity: warning
- [ ]
Overfitting: the −10% returns_20d threshold was hand-picked with full knowledge of the COVID crash; no parameter-sensitivity or out-of-sample test was run.
- [ ]
Selection/survivorship bias: AAPL is a known COVID winner; a single-ticker result says nothing about the rule's behavior on losers or the broad market.
- [ ]
Whipsaw fragility: 13 of 17 trades lost (25% win rate); PnL is concentrated in a few trades — the rule churned around the threshold during volatile stretches.
- [ ]
Structural constraint: the backtester maps -1 to short-entry, so the strategy can never sit in cash after its first signal; it is always long or short.
- No costs modeled: 17 round-trips with no commission, slippage, or short-borrow costs.
- [ ]
Metric scope: risk_metrics are derived from AAPL's market returns in data.json, not from strategy PnL (per the metrics reference) — asset-level, not strategy-level.
- [x]
No look-ahead/leakage found: returns_20d uses only past closes; execution assumes same-bar market-on-close fills (optimistic by a few basis points, not materially).
Recommendation: Treat this as a rejected first hypothesis. Next: test threshold sensitivity (−8% / −12% / −15%) across a multi-ticker universe of winners and losers with transaction costs, or replace the rule with an SMA-regime strategy run through a backtester that supports a cash state — before trusting any of these numbers.
Verdict
The hypothesis is not supported. The strategy made +48.45% but lost to plain buy-and-hold on every headline number: return (+48.45% vs +83.71%), risk-adjusted return (Sharpe 1.04 vs 1.19), and it barely improved on drawdown (−26.62% vs −31.43%). The crash-regime short concept was directionally sensible but the single hand-tuned −10% threshold churned through 17 trades at a 25% win rate, adding noise rather than alpha.
Limitations: one asset, one regime-heavy period, threshold fitted in-sample to the very crash it traded, no transaction/borrow costs, and the backtester cannot hold cash.
Next test: parameter-sensitivity sweep on a multi-ticker universe (including COVID losers) with costs modeled — if the rule only works at −10% on AAPL, it does not work.
Generated by Aurelion Quant Research Agent
Connects securely to your tools. The creator never sees your data.
About this skill
Use when the user wants to develop or test a trading strategy, backtest signals, research a market hypothesis (momentum, mean reversion, factors), compute risk metrics, or get a skeptical second opinion on quant results.
Aurelion is an autonomous quantitative research pipeline. You give it a research objective in plain English; it drives the whole path — hypothesis → market data → feature engineering → strategy → VectorBT backtest → risk metrics → critique → Markdown report. The agent performs all the reasoning (hypothesis formation, strategy writing, evaluation, skeptical critique); the bundled scripts perform all the deterministic compute, so runs are reproducible and auditable.
The eight-stage protocol:
- Pre-flight — verifies Python, imports (pandas/numpy/yfinance/vectorbt) and Yahoo connectivity before any data work; halts with the verbatim error if anything fails.
- Literature & hypothesis — structures the objective into statement, signals, tickers, date range, entry/exit logic. Asks the user first if any key condition is unclear.
- Data preparation — fetches OHLCV (or local CSVs) and engineers features: SMA 10/20/50/200, RSI-14, 20/50-day volatility, volume ratios, multi-horizon returns. Prints the authoritative column list the strategy must use.
- Strategy — writes a generate_signals(df) function under a strict contract: one -1/0/1 signal per row, only past/present data, no look-ahead.
- Backtest — runs VectorBT per ticker with explicit entry/exit semantics; strategy code errors are auto-fixed up to 3 times.
- Evaluate — Sharpe, Sortino, Calmar, VaR/CVaR, max drawdown against documented thresholds. Conservative stance: a good Sharpe never excuses a high drawdown.
- Critique — a deliberately skeptical review for data leakage, look-ahead bias, survivorship bias and overfitting, output as severity-tagged JSON. Critical findings get 3 revisions (4 attempts total); if unresolved, the report says so prominently.
- Report — fills a template with hypothesis, full strategy code, per-ticker tables, risk assessment, critique and an honest verdict with limitations.
Failure handling is strict by design: scripts exit non-zero on halt, stderr is relayed verbatim, Yahoo throttling gets one built-in retry then a local-CSV fallback offer, and the pipeline never continues on partial data or fabricates results. All outputs (data.json, strategy.py, results.json, report.md) land in aurelion-work/ inside your project directory.
- Data source is Yahoo Finance: throttling gets one built-in 15-second retry, then the run halts with a local-CSV fallback offer — no silent data substitution.
- Backtests model no transaction costs or slippage; daily frequency; $100,000 default capital split equally across tickers. Frictionless results read optimistic versus live trading.
- Single in-sample window: no walk-forward or out-of-sample validation, so results can be overfit to the chosen date range. This is the largest gap between this skill and desk-grade research.
- The signal engine is always-in-market (long/short reversal, no flat state) — strategies that need to sit out between trades are not expressible.
- Tail-risk metrics (VaR/CVaR/Sortino) are computed from market closes, not the strategy equity curve.
- One dataframe per ticker: no cross-sectional ranking, pairs/cointegration, or cross-asset signals. 200-row minimum history per ticker (SMA_200 warm-up).
- Agent-written strategies get a skeptical critique stage, not a mathematical proof — results are research evidence, not investment advice.
- Planned for pro version (not in this version): transaction-cost modeling, walk-forward / deflated-Sharpe validation, cross-sectional and pairs strategies.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 13 days ago
- Free with an Agensi account
Requires
Permissions
File Scopes