Stock Analysis
Stock and company analysis plus strategy backtesting using direct recent-price
feeds and the Rebyte financial data lake.
Requires Rebyte API auth — $AUTH_TOKEN and $API_URL are set up per the
agent's system prompt; use them as Bearer token and base URL.
Skill layout — load the pillar you need
| Pillar |
When |
| this file |
Analysis playbooks: price checks, company overviews, comparisons, fundamentals, technicals |
data/SKILL.md |
Data routing and mechanics: direct two-date prices, full 19-table lake catalog (US + CN), SQL patterns, news + research search, error rules. Read before fetching data. |
backtesting/SKILL.md |
Strategy simulation: 5-phase NautilusTrader workflow ending in a backtest result bundle |
financial-templates/SKILL.md |
Analysis structures (DCF, comps, memo formats) with no data calls |
report-style/README.md |
Kami design system for every HTML report this skill delivers |
references/sec-edgar.md |
SEC filings, full 10-K/10-Q text, insider (Form 4) trades via edgartools |
Price/K-line charts: use the financial-charts skill (TradingView-style
Lightweight Charts).
Data sources
| Source |
What it provides |
Access |
| Direct recent-price APIs |
Price-only OHLCV bars for the current and previous exchange-local calendar dates. US minute bars use stocks/bars with interval: "1min"; China minute bars use cn-stocks/bars_1min. |
POST $API_URL/api/data/stocks/bars, POST $API_URL/api/data/cn-stocks/bars, or POST $API_URL/api/data/cn-stocks/bars_1min — see data/SKILL.md |
| Rebyte financial data lake |
US: daily + 1-minute bars, news, SEC-filing fundamentals, splits, dividends, short data, ticker universe, IPOs. CN A-shares: daily + 1-minute bars, valuation snapshots, financial statements, money flow, unusual-move disclosures. |
Read-only SQL via POST $API_URL/api/data/financial/sql — see data/SKILL.md |
| News archive |
US equity news coverage back to 2016, searchable by meaning |
POST $API_URL/api/data/research/news — see data/SKILL.md |
| Research library |
~4,300 long-form articles from 13 investment research publications (SemiAnalysis, SemiVision, MacroCharts, Capital Wars, Citrini, Doomberg, Michael J Burry and others), 2020 to today. Primary analysis by named practitioners — use it for theses, debates, and mechanisms. |
POST $API_URL/api/data/research/search, then /context or /article — see data/SKILL.md |
| SEC EDGAR |
Full filing text (10-K, 10-Q, 8-K), filing sections, insider (Form 4) trades |
edgartools Python library — see references/sec-edgar.md |
Route by freshness. Use the direct APIs for "current", "today", "latest
price", and recent intraday questions. Their range is fixed server-side to the
current and previous calendar dates in America/New_York (US) or
Asia/Shanghai (CN); callers cannot widen it. Use the lake for every older or
non-price fact. The US response exposes Polygon's upstreamStatus (for example
DELAYED), so never imply tick-level realtime. State the source, returned date
range, latest bar timestamp, and feed status when present. During market hours,
use minute bars in both markets; treat the current date's daily bar as final
only after that market closes.
Analysis Workflows
Use direct prices for the two-date edge and lake SQL for historical or
non-price steps. Exact routing and request shapes are in data/SKILL.md.
1. Quick Stock Check
User: "What's AAPL doing?" / "AAPL price"
→ Direct recent bars — quote the latest close, timestamp, date range, feed status
→ Lake daily bars (last 1 month) + ticker details for context
→ Present: latest direct price + recent trend + basic company info
2. Company Overview
User: "Tell me about NVDA" / "What does Tesla do?"
→ Ticker details + latest fundamentals period (revenue, net income)
→ Daily bars (last 3 months)
→ Direct recent bars when presenting a latest/current price
→ Recent news (5 headlines) — semantic search for themes if needed
→ Present: business summary, market position, recent performance, news themes
3. Technical Analysis
User: "Is TSLA a good buy?" / "AAPL technical analysis"
→ Daily bars (last 6 months) — trend, support/resistance
→ Direct recent intraday bars — current short-term momentum
→ Lake 1-minute bars aggregated to hourly when more than two dates are needed
→ Recent news (10 articles) — read and judge the tone yourself
→ Compute: moving averages, price range, volume trends
→ Present: trend direction, key levels, volume analysis, sentiment, outlook
4. Multi-Stock Comparison
User: "Compare AAPL vs MSFT vs GOOGL"
→ One SQL per dataset covering all tickers (WHERE ticker IN (...))
→ Direct recent bars for each ticker when current prices are part of the comparison
→ Compare: price performance, fundamentals, news flow
→ Present: side-by-side table, relative performance
5. Fundamental Deep Dive
User: "AAPL financials" / "NVDA revenue trend"
→ Fundamentals: annual (5 periods) + quarterly (4 periods)
→ Dividends (last 12) — history and implied yield vs latest direct close
→ Weekly-aggregated bars (last 2 years) — long-term price context
→ Compute: revenue growth, margin trends, EPS trend, payout ratio
→ Optional: SEC EDGAR for full 10-K text
6. Insider Activity
User: "Insider trading for TSLA" / "Are executives buying NVDA?"
→ SEC EDGAR: Form 4 filings (the lake does not carry insider trades)
→ Daily bars (last 3 months) — price context around the trades
→ Present: recent transactions, insider sentiment, correlation with price
7. Due Diligence Package
User: "Full analysis of MSFT" / "Due diligence on AMD"
→ Ticker details, 1y daily bars, annual + quarterly fundamentals,
dividends, splits, 20 recent news items
→ Direct recent bars for the current price snapshot
→ SEC EDGAR: latest 10-K, recent 8-Ks, Form 4 insider trades
→ Present: comprehensive report (Kami-styled HTML per report-style/)
8. Sector Research
User: "Compare cloud stocks" / "Best semiconductor stocks"
→ Identify tickers (us.tickers can filter by name/type/exchange)
→ Batch daily bars + fundamentals across the set
→ Semantic news search on the sector theme
→ Present: sector overview, leaders, relative performance
9. Strategy Backtest
User: "Backtest an SMA crossover on AAPL" / "验证我的策略"
→ Switch to backtesting/SKILL.md and run its 5 phases end-to-end
→ Deliverable is the backtest bundle at /code/backtests/<slug>/
Trigger Patterns
ALWAYS fetch data when the user mentions any of these. Do NOT answer from
memory — route to the direct price API and/or lake as specified.
| User intent |
Required actions |
| Stock symbol mentioned (AAPL, $TSLA, 000001.SZ) |
Direct recent bars + lake ticker details |
| "current", "today", "latest price", "how is X doing" |
Direct recent bars first; include marketDateRange, latest timestamp, and feed status |
| Historical "price" or "chart" |
Lake bars for the requested range; add direct bars only when the latest edge matters |
| "news", "what's happening with" |
News query (10+ items) or semantic search |
| "analyze", "research", "tell me about" |
Details + bars + news |
| "compare", "vs", "versus" |
All datasets for each stock, side-by-side |
| "buy", "sell", "good investment" |
Bars + news + fundamentals (annual + quarterly) |
| "financials", "revenue", "earnings" |
Fundamentals (annual + quarterly) |
| "dividend", "yield", "payout" |
us.dividends |
| "split", "stock split" |
us.splits |
| "short interest", "shorts" |
us.short_interest / us.short_volume |
| "insider", "who's buying/selling" |
SEC EDGAR Form 4 filings |
| "10-K", "10-Q", "SEC filing" |
SEC EDGAR filings |
| "backtest", "回测", "strategy performance" |
backtesting/SKILL.md |
Lake SQL recipes
Auth + request format, DataFusion-style SQL patterns, the on-error rule, and
the full table catalog are in data/SKILL.md. The recipes below map the
common analysis needs; tickers are UPPERCASE for US, NNNNNN.SZ/NNNNNN.SH
for CN.
-- Price bars, daily (raw, unadjusted; check us.splits before spanning a split)
SELECT t, o, h, l, c, v FROM us.eod
WHERE ticker = 'AAPL' AND t >= to_timestamp('2026-01-01')
ORDER BY t
-- Intraday / custom intervals: aggregate 1-minute bars
SELECT date_bin(INTERVAL '1 hour', t, TIMESTAMP '1970-01-01') AS bucket,
min(t) AS t_open, max(h) AS h, min(l) AS l, sum(v) AS v
FROM us.bars_1m
WHERE ticker = 'AAPL' AND t >= now() - INTERVAL '5 days'
GROUP BY bucket ORDER BY bucket
-- News for a ticker (tickers is an array column)
SELECT published_utc, title, tickers FROM us.news
WHERE array_has(tickers, 'AAPL')
ORDER BY published_utc DESC LIMIT 10
-- Thematic retrieval ("news about AI chip demand"): use research/news instead
-- of ILIKE; for theses and mechanisms use research/search — see data/SKILL.md.
-- Fundamentals (SEC-filing derived; is_* income, bs_* balance, cf_* cashflow)
SELECT fiscal_year, fiscal_period, is_revenues, is_gross_profit,
is_operating_income_loss, is_net_income_loss,
is_diluted_earnings_per_share, bs_assets, bs_liabilities, bs_equity,
cf_net_cash_flow_from_operating_activities
FROM us.fundamentals
WHERE array_has(tickers, 'AAPL') AND timeframe = 'annual'
ORDER BY fiscal_year DESC LIMIT 5
-- Dividends / splits
SELECT ex_dividend_date, cash_amount, frequency FROM us.dividends
WHERE ticker = 'AAPL' ORDER BY ex_dividend_date DESC LIMIT 12;
SELECT execution_date, split_from, split_to FROM us.splits
WHERE ticker = 'AAPL' ORDER BY execution_date DESC
-- Ticker details / universe screen
SELECT ticker, name, primary_exchange, type, active, cik FROM us.tickers
WHERE ticker = 'AAPL'
-- CN A-share daily bars (adj_factor included for adjusted series)
SELECT t, o, h, l, c, v, pct_chg, adj_factor FROM cn.bars_day
WHERE ts_code = '000001.SZ' AND t >= to_timestamp('2026-01-01')
ORDER BY t
-- CN valuation snapshot / financial indicators
SELECT trade_date, pe_ttm, pb, turnover_rate, total_mv FROM cn.daily_basic
WHERE ts_code = '000001.SZ' ORDER BY trade_date DESC LIMIT 20
The data/scripts/financial_cli.py helper wraps auth + the SQL endpoint:
python3 data/scripts/financial_cli.py catalog
python3 data/scripts/financial_cli.py schema us.eod
python3 data/scripts/financial_cli.py query "SELECT ... LIMIT 10"
python3 data/scripts/financial_cli.py news "Fed rate cut expectations" --ticker NVDA
python3 data/scripts/financial_cli.py research "global liquidity and central bank balance sheets"
SEC EDGAR Reference
For full filing text, filing sections, and insider trading data, see
references/sec-edgar.md.
Quick start:
pip install edgartools
from edgar import Company, set_identity
set_identity("Rebyte Agent agent@rebyte.ai")
company = Company("AAPL")
filings = company.get_filings(form="10-K") # Annual reports
insider = company.get_filings(form="4") # Insider trades
Analysis Guidelines
Computing Technical Indicators from Price Bars
The lake returns raw OHLCV. Compute indicators yourself (or in SQL):
- Simple Moving Average (SMA): average of last N closes (20-day and 50-day)
- Price trend: current close vs 20-day and 50-day SMA
- Support/Resistance: recent lows/highs from daily bars
- Volume trend: recent volume vs 20-day average volume
- 52-week range: min low / max high over 1 year of daily bars
- Corporate actions:
us.eod is unadjusted — when the window spans a
split, adjust with us.splits; CN daily bars carry adj_factor directly
Reading News
Lake news carries no precomputed sentiment — read the headlines/content and
judge the tone yourself, noting publisher weight and recency. For thematic
questions, prefer the semantic search endpoint over keyword ILIKE.
Financial Statement Analysis
- Revenue growth: YoY change across periods
- Margin trends: gross/operating/net margin over time
- Cash position: cash & equivalents vs total debt
- Earnings quality: operating cash flow vs net income (should be close)
Presenting Results
- Lead with the answer (bullish/bearish/neutral, latest sourced close + timestamp, key metric)
- Use tables for multi-stock comparisons
- Include specific numbers with dates — never vague statements
- Distinguish facts (from data) from analysis (your interpretation)
- State each source and date range explicitly; report direct-feed status and
label lake data T+1
- Long-form deliverables: Kami-styled HTML per
report-style/
Important Notes
- US tickers UPPERCASE (
AAPL); CN codes suffixed (000001.SZ, 600519.SH)
- All timestamps UTC
- Direct prices cover two exchange-local calendar dates only — weekends and
holidays can yield empty dates; do not widen the direct request
- Lake data is T+1 — daily tables land the prior trading day
- Direct means recent, not guaranteed tick realtime — during market hours,
use US
stocks/bars with interval: "1min" and CN cn-stocks/bars_1min;
report Polygon's upstreamStatus, and use completed daily bars after close
- Coverage: US from 2021-06 (bars) with reference data much deeper (splits 1978→, dividends 2000→); CN daily from 1990-12 — full catalog in
data/SKILL.md
- SEC EDGAR is free — no API key, but requires an identity string
When NOT to Use This Skill
- Simple web lookup ("What's Apple's website?") → use web search
- Live trading, tick execution, bid/ask, or streaming quotes → not supported;
direct prices are OHLCV bars and may be delayed
- Personal financial advice → not qualified
1---2name: stock-analysis3description: The single financial skill for stock and company analysis plus strategy backtesting. Uses direct recent-price APIs for the current and previous exchange-local calendar dates, and the Rebyte financial data lake for historical prices, news, fundamentals, dividends/splits, screening, and backtests across US equities and China A-shares. Also covers SEC EDGAR insider/filing research and multi-stock comparison. Use for stock tickers, current/latest prices, price history, technical or company analysis, investment research, financial data, and strategy backtests. Triggers include AAPL, TSLA, 000001.SZ, 'stock price', 'today', 'latest price', 'analyze stock', 'compare stocks', 'company financials', 'insider trading', 'SEC filing', 'is X a good buy', 'backtest', and '回测'.4---56# Stock Analysis78Stock and company analysis plus strategy backtesting using direct recent-price9feeds and the Rebyte financial data lake.1011**Requires Rebyte API auth** — `$AUTH_TOKEN` and `$API_URL` are set up per the12agent's system prompt; use them as Bearer token and base URL.1314## Skill layout — load the pillar you need1516| Pillar | When |17|---|---|18| this file | Analysis playbooks: price checks, company overviews, comparisons, fundamentals, technicals |19| [`data/SKILL.md`](data/SKILL.md) | Data routing and mechanics: direct two-date prices, full 19-table lake catalog (US + CN), SQL patterns, news + research search, error rules. **Read before fetching data.** |20| [`backtesting/SKILL.md`](backtesting/SKILL.md) | Strategy simulation: 5-phase NautilusTrader workflow ending in a backtest result bundle |21| [`financial-templates/SKILL.md`](financial-templates/SKILL.md) | Analysis structures (DCF, comps, memo formats) with no data calls |22| [`report-style/README.md`](report-style/README.md) | Kami design system for every HTML report this skill delivers |23| `references/sec-edgar.md` | SEC filings, full 10-K/10-Q text, insider (Form 4) trades via edgartools |2425Price/K-line charts: use the **`financial-charts`** skill (TradingView-style26Lightweight Charts).2728## Data sources2930| Source | What it provides | Access |31|--------|-----------------|--------|32| **Direct recent-price APIs** | Price-only OHLCV bars for the current and previous exchange-local calendar dates. US minute bars use `stocks/bars` with `interval: "1min"`; China minute bars use `cn-stocks/bars_1min`. | `POST $API_URL/api/data/stocks/bars`, `POST $API_URL/api/data/cn-stocks/bars`, or `POST $API_URL/api/data/cn-stocks/bars_1min` — see `data/SKILL.md` |33| **Rebyte financial data lake** | US: daily + 1-minute bars, news, SEC-filing fundamentals, splits, dividends, short data, ticker universe, IPOs. CN A-shares: daily + 1-minute bars, valuation snapshots, financial statements, money flow, unusual-move disclosures. | Read-only SQL via `POST $API_URL/api/data/financial/sql` — see `data/SKILL.md` |34| **News archive** | US equity news coverage back to 2016, searchable by meaning | `POST $API_URL/api/data/research/news` — see `data/SKILL.md` |35| **Research library** | ~4,300 long-form articles from 13 investment research publications (SemiAnalysis, SemiVision, MacroCharts, Capital Wars, Citrini, Doomberg, Michael J Burry and others), 2020 to today. Primary analysis by named practitioners — use it for theses, debates, and mechanisms. | `POST $API_URL/api/data/research/search`, then `/context` or `/article` — see `data/SKILL.md` |36| **SEC EDGAR** | Full filing text (10-K, 10-Q, 8-K), filing sections, insider (Form 4) trades | `edgartools` Python library — see `references/sec-edgar.md` |3738**Route by freshness.** Use the direct APIs for "current", "today", "latest39price", and recent intraday questions. Their range is fixed server-side to the40current and previous calendar dates in `America/New_York` (US) or41`Asia/Shanghai` (CN); callers cannot widen it. Use the lake for every older or42non-price fact. The US response exposes Polygon's `upstreamStatus` (for example43`DELAYED`), so never imply tick-level realtime. State the source, returned date44range, latest bar timestamp, and feed status when present. During market hours,45use minute bars in both markets; treat the current date's daily bar as final46only after that market closes.4748---4950## Analysis Workflows5152Use direct prices for the two-date edge and lake SQL for historical or53non-price steps. Exact routing and request shapes are in `data/SKILL.md`.5455### 1. Quick Stock Check56```57User: "What's AAPL doing?" / "AAPL price"58→ Direct recent bars — quote the latest close, timestamp, date range, feed status59→ Lake daily bars (last 1 month) + ticker details for context60→ Present: latest direct price + recent trend + basic company info61```6263### 2. Company Overview64```65User: "Tell me about NVDA" / "What does Tesla do?"66→ Ticker details + latest fundamentals period (revenue, net income)67→ Daily bars (last 3 months)68→ Direct recent bars when presenting a latest/current price69→ Recent news (5 headlines) — semantic search for themes if needed70→ Present: business summary, market position, recent performance, news themes71```7273### 3. Technical Analysis74```75User: "Is TSLA a good buy?" / "AAPL technical analysis"76→ Daily bars (last 6 months) — trend, support/resistance77→ Direct recent intraday bars — current short-term momentum78→ Lake 1-minute bars aggregated to hourly when more than two dates are needed79→ Recent news (10 articles) — read and judge the tone yourself80→ Compute: moving averages, price range, volume trends81→ Present: trend direction, key levels, volume analysis, sentiment, outlook82```8384### 4. Multi-Stock Comparison85```86User: "Compare AAPL vs MSFT vs GOOGL"87→ One SQL per dataset covering all tickers (WHERE ticker IN (...))88→ Direct recent bars for each ticker when current prices are part of the comparison89→ Compare: price performance, fundamentals, news flow90→ Present: side-by-side table, relative performance91```9293### 5. Fundamental Deep Dive94```95User: "AAPL financials" / "NVDA revenue trend"96→ Fundamentals: annual (5 periods) + quarterly (4 periods)97→ Dividends (last 12) — history and implied yield vs latest direct close98→ Weekly-aggregated bars (last 2 years) — long-term price context99→ Compute: revenue growth, margin trends, EPS trend, payout ratio100→ Optional: SEC EDGAR for full 10-K text101```102103### 6. Insider Activity104```105User: "Insider trading for TSLA" / "Are executives buying NVDA?"106→ SEC EDGAR: Form 4 filings (the lake does not carry insider trades)107→ Daily bars (last 3 months) — price context around the trades108→ Present: recent transactions, insider sentiment, correlation with price109```110111### 7. Due Diligence Package112```113User: "Full analysis of MSFT" / "Due diligence on AMD"114→ Ticker details, 1y daily bars, annual + quarterly fundamentals,115 dividends, splits, 20 recent news items116→ Direct recent bars for the current price snapshot117→ SEC EDGAR: latest 10-K, recent 8-Ks, Form 4 insider trades118→ Present: comprehensive report (Kami-styled HTML per report-style/)119```120121### 8. Sector Research122```123User: "Compare cloud stocks" / "Best semiconductor stocks"124→ Identify tickers (us.tickers can filter by name/type/exchange)125→ Batch daily bars + fundamentals across the set126→ Semantic news search on the sector theme127→ Present: sector overview, leaders, relative performance128```129130### 9. Strategy Backtest131```132User: "Backtest an SMA crossover on AAPL" / "验证我的策略"133→ Switch to backtesting/SKILL.md and run its 5 phases end-to-end134→ Deliverable is the backtest bundle at /code/backtests/<slug>/135```136137---138139## Trigger Patterns140141**ALWAYS fetch data when the user mentions any of these. Do NOT answer from142memory — route to the direct price API and/or lake as specified.**143144| User intent | Required actions |145|------------|-----------------|146| Stock symbol mentioned (AAPL, $TSLA, 000001.SZ) | Direct recent bars + lake ticker details |147| "current", "today", "latest price", "how is X doing" | Direct recent bars first; include `marketDateRange`, latest timestamp, and feed status |148| Historical "price" or "chart" | Lake bars for the requested range; add direct bars only when the latest edge matters |149| "news", "what's happening with" | News query (10+ items) or semantic search |150| "analyze", "research", "tell me about" | Details + bars + news |151| "compare", "vs", "versus" | All datasets for each stock, side-by-side |152| "buy", "sell", "good investment" | Bars + news + fundamentals (annual + quarterly) |153| "financials", "revenue", "earnings" | Fundamentals (annual + quarterly) |154| "dividend", "yield", "payout" | `us.dividends` |155| "split", "stock split" | `us.splits` |156| "short interest", "shorts" | `us.short_interest` / `us.short_volume` |157| "insider", "who's buying/selling" | SEC EDGAR Form 4 filings |158| "10-K", "10-Q", "SEC filing" | SEC EDGAR filings |159| "backtest", "回测", "strategy performance" | `backtesting/SKILL.md` |160161---162163## Lake SQL recipes164165Auth + request format, DataFusion-style SQL patterns, the on-error rule, and166the full table catalog are in `data/SKILL.md`. The recipes below map the167common analysis needs; tickers are UPPERCASE for US, `NNNNNN.SZ`/`NNNNNN.SH`168for CN.169170```sql171-- Price bars, daily (raw, unadjusted; check us.splits before spanning a split)172SELECT t, o, h, l, c, v FROM us.eod173WHERE ticker = 'AAPL' AND t >= to_timestamp('2026-01-01')174ORDER BY t175176-- Intraday / custom intervals: aggregate 1-minute bars177SELECT date_bin(INTERVAL '1 hour', t, TIMESTAMP '1970-01-01') AS bucket,178 min(t) AS t_open, max(h) AS h, min(l) AS l, sum(v) AS v179FROM us.bars_1m180WHERE ticker = 'AAPL' AND t >= now() - INTERVAL '5 days'181GROUP BY bucket ORDER BY bucket182183-- News for a ticker (tickers is an array column)184SELECT published_utc, title, tickers FROM us.news185WHERE array_has(tickers, 'AAPL')186ORDER BY published_utc DESC LIMIT 10187-- Thematic retrieval ("news about AI chip demand"): use research/news instead188-- of ILIKE; for theses and mechanisms use research/search — see data/SKILL.md.189190-- Fundamentals (SEC-filing derived; is_* income, bs_* balance, cf_* cashflow)191SELECT fiscal_year, fiscal_period, is_revenues, is_gross_profit,192 is_operating_income_loss, is_net_income_loss,193 is_diluted_earnings_per_share, bs_assets, bs_liabilities, bs_equity,194 cf_net_cash_flow_from_operating_activities195FROM us.fundamentals196WHERE array_has(tickers, 'AAPL') AND timeframe = 'annual'197ORDER BY fiscal_year DESC LIMIT 5198199-- Dividends / splits200SELECT ex_dividend_date, cash_amount, frequency FROM us.dividends201WHERE ticker = 'AAPL' ORDER BY ex_dividend_date DESC LIMIT 12;202SELECT execution_date, split_from, split_to FROM us.splits203WHERE ticker = 'AAPL' ORDER BY execution_date DESC204205-- Ticker details / universe screen206SELECT ticker, name, primary_exchange, type, active, cik FROM us.tickers207WHERE ticker = 'AAPL'208209-- CN A-share daily bars (adj_factor included for adjusted series)210SELECT t, o, h, l, c, v, pct_chg, adj_factor FROM cn.bars_day211WHERE ts_code = '000001.SZ' AND t >= to_timestamp('2026-01-01')212ORDER BY t213214-- CN valuation snapshot / financial indicators215SELECT trade_date, pe_ttm, pb, turnover_rate, total_mv FROM cn.daily_basic216WHERE ts_code = '000001.SZ' ORDER BY trade_date DESC LIMIT 20217```218219The `data/scripts/financial_cli.py` helper wraps auth + the SQL endpoint:220221```bash222python3 data/scripts/financial_cli.py catalog223python3 data/scripts/financial_cli.py schema us.eod224python3 data/scripts/financial_cli.py query "SELECT ... LIMIT 10"225python3 data/scripts/financial_cli.py news "Fed rate cut expectations" --ticker NVDA226python3 data/scripts/financial_cli.py research "global liquidity and central bank balance sheets"227```228229---230231## SEC EDGAR Reference232233For full filing text, filing sections, and insider trading data, see234[references/sec-edgar.md](references/sec-edgar.md).235236**Quick start:**237```python238pip install edgartools239```240```python241from edgar import Company, set_identity242set_identity("Rebyte Agent agent@rebyte.ai")243244company = Company("AAPL")245filings = company.get_filings(form="10-K") # Annual reports246insider = company.get_filings(form="4") # Insider trades247```248249---250251## Analysis Guidelines252253### Computing Technical Indicators from Price Bars254255The lake returns raw OHLCV. Compute indicators yourself (or in SQL):256257- **Simple Moving Average (SMA)**: average of last N closes (20-day and 50-day)258- **Price trend**: current close vs 20-day and 50-day SMA259- **Support/Resistance**: recent lows/highs from daily bars260- **Volume trend**: recent volume vs 20-day average volume261- **52-week range**: min low / max high over 1 year of daily bars262- **Corporate actions**: `us.eod` is unadjusted — when the window spans a263 split, adjust with `us.splits`; CN daily bars carry `adj_factor` directly264265### Reading News266267Lake news carries no precomputed sentiment — read the headlines/content and268judge the tone yourself, noting publisher weight and recency. For thematic269questions, prefer the semantic search endpoint over keyword `ILIKE`.270271### Financial Statement Analysis272273- **Revenue growth**: YoY change across periods274- **Margin trends**: gross/operating/net margin over time275- **Cash position**: cash & equivalents vs total debt276- **Earnings quality**: operating cash flow vs net income (should be close)277278### Presenting Results279280- Lead with the answer (bullish/bearish/neutral, latest sourced close + timestamp, key metric)281- Use tables for multi-stock comparisons282- Include specific numbers with dates — never vague statements283- Distinguish facts (from data) from analysis (your interpretation)284- State each source and date range explicitly; report direct-feed status and285 label lake data T+1286- Long-form deliverables: Kami-styled HTML per `report-style/`287288---289290## Important Notes291292- **US tickers UPPERCASE** (`AAPL`); **CN codes suffixed** (`000001.SZ`, `600519.SH`)293- **All timestamps UTC**294- **Direct prices cover two exchange-local calendar dates only** — weekends and295 holidays can yield empty dates; do not widen the direct request296- **Lake data is T+1** — daily tables land the prior trading day297- **Direct means recent, not guaranteed tick realtime** — during market hours,298 use US `stocks/bars` with `interval: "1min"` and CN `cn-stocks/bars_1min`;299 report Polygon's `upstreamStatus`, and use completed daily bars after close300- **Coverage**: US from 2021-06 (bars) with reference data much deeper (splits 1978→, dividends 2000→); CN daily from 1990-12 — full catalog in `data/SKILL.md`301- **SEC EDGAR is free** — no API key, but requires an identity string302303---304305## When NOT to Use This Skill306307- **Simple web lookup** ("What's Apple's website?") → use web search308- **Live trading, tick execution, bid/ask, or streaming quotes** → not supported;309 direct prices are OHLCV bars and may be delayed310- **Personal financial advice** → not qualified