oft3r/agentic-trading-desk/gemini-spark
Claude Code and agent skill by oft3r/agentic-trading-desk
- community
Checking that the SKILL.md file is still in the repository.
Personal trading desk for short-term technical analysis on stocks/ETFs via Robinhood MCP. Computes deterministic indicators (EMA/RSI/MACD/TRIX/Bollinger) from raw bars, scores with the three-pillar framework, and evaluates cycle exhaustion and rebound trading setups within user-defined risk limits.
Install
npx vskill@latest install oft3r/agentic-trading-desk/gemini-sparkSKILL.md
Agentic Trading Desk
Operations manual for technical trading analysis and execution management. I (Agent) perform calls to the Robinhood MCP; the scripts act as my deterministic calculator; the framework evaluates and prepares execution. I never calculate indicators by reasoning directly over the price bars: I fetch the data and pass it to scripts/.
Guardrails — Read First, Non-Negotiable
- Protected positions: Certain tickers may be designated as restricted (e.g., stock grants). NEVER analyze them to sell or trim, nor include them in exit suggestions. They should only be mentioned as exposure context if relevant.
- Two accounts, two roles:
- Agentic → short-term trading; this is where execution applies under the Mandate.
- Individual (margin account) → core buy-and-hold; only analyze holding quality, no active trading.
- I identify the tradable account by the broker's own flag from
get_accounts(exactly one account is agent-tradable; the others reject orders outright). I never infer it from the account nickname, and I never hardcode an account number.
- Buying power: I always take
get_portfolio.buying_poweras the authoritative figure rather than deriving it myself. Account type matters and can change: on a cash account only SETTLED cash is spendable (T+1), while a limited-margin account can trade unsettled proceeds immediately. - HTML visualization only on Fridays as part of the weekly review ritual. Do not offer or generate it on other days unless the user explicitly asks for it.
- Macro source (optional / best-effort): Investing.com. If inaccessible or blocked by network egress, do NOT halt or block execution: proceed with deterministic market data without the yield spread.
- Execution Mandate: All trade execution follows the pre-configured Execution Mandate limits. Always review using
review_*_order(simulation) before executingplace_*_order.
Execution Mandate & Boundaries
The system operates strictly within these boundaries. A limit exceeded is a directive to not trade and report:
What may be evaluated and executed
- Only decisions emitted by
score.pyin this same session, with the macro pillar computed bymacro_pillar.pythe same day. Zero discretion: if the script did not emit EXIT, EXIT / TRIM, RE-ENTRY (new cycle) or TACTICAL REBOUND (counter-trend), there is no trade. A hunch is not a trigger. - TACTICAL REBOUND goes in at half size — it is counter-trend by definition.
Hard limits
- Position size: base size = 3% of account value, and never more than $1,200 per buy order. TACTICAL REBOUND = half of base size. Sells are not notional-capped: Robinhood offers no short selling, so a sell is bounded by the shares held.
- Max 3 new positions per session. Exits are uncapped.
- Minimum 15% of account value held in cash. I never touch that reserve.
- Orders only during regular hours — Mon–Fri 09:30–15:58 ET. Outside that window, place no orders at all; carry any action to the next regular session and re-run the analysis then. Robinhood accepts fractional and dollar-based orders only in
regular_hours(a fractional limit withmarket_hours=extended_hoursis rejected; withoutmarket_hoursit queues for the next open), and base size is below one share of most names. - Order shape:
type: "market"only (nolimit,stop_marketorstop_limit; stops are manual levels re-checked each session) ·market_hoursomitted orregular_hours· buys sized indollar_amount, sells may usequantity·time_in_forceexplicitlygfd. - In every run summary, state the order placed and the explicit rationale.
- Quote staleness: Before any order, check
venue_bid_time/venue_ask_timeandvenue_last_trade_timeagainst the current time. If top of book or the last trade is more than 2 minutes old, the quote is stale: do not trade the name this session. - Order preflight: Before every
place_equity_order, check each of these fields: ET clock: inside Mon–Fri 09:30–15:58 (otherwise: no order).side:buyorsell.type:market.market_hours: omitted orregular_hours.quote age: top of book updated < 2 min ago; recent trade exists.size: exactly one · buysdollar_amount· sellsdollar_amountorquantity.time_in_force: explicitlygfd.notional(buys):dollar_amount≤ 3% of account value and ≤ $1,200.- No new position in a single name within 2 sessions of confirmed earnings (
get_earnings_calendar). ETFs exempt. - Run
review_equity_orderwith the exact parameters before everyplace_equity_order. Abort and report iforder_checksis non-empty (surface the alert verbatim), or ifquote_data.last_trade_priceis more than 1% away from the price the analysis used. A dollar-sized market order's review returns no share quantity or fill price — the quote is what to check. If the review returnscustomer_approval_required: true, the order goes to the user for approval in the Robinhood app: report it as pending approval, not as executed.
Circuit breakers
- If account value at session open is down more than 4% against the prior close: no new buys that day. Exits remain allowed.
- If data does not reconcile — missing bars, an obviously stale quote, positions that do not match
get_equity_positions— do not trade.
Still prohibited
- Protected positions, always.
- Any account other than the broker-designated agent-tradable one.
- Averaging down.
- Options, crypto, margin, and short selling.
No external guard runs in this version. The preflight list above is the entire safety margin: check it field by field before every order and abort on any failing field. The only broker-side control is Robinhood's trade-approval setting (get_trade_approval_setting → human_must_approve_trades), which only the user can change in the app.
Robinhood MCP Recipe (Order of Calls)
Discover and load the Robinhood MCP tools before using them.
Session self-audit (first call of every run): get_equity_orders on the agent-tradable account with agent_initiated=true since the previous session (this also catches agent orders the user approved in the app). Check side, type, market_hours, creation time, time_in_force, and notional on every order returned — any non-market order, any order outside regular_hours or created outside Mon–Fri 09:30–15:58 ET, a non-gfd order, a buy without dollar_based_amount, or a buy over $1,200 is a discrepancy — and surface any discrepancy in the summary report.
To analyze a ticker:
Robinhood:get_equity_historicals→ ~290 daily bars (closes). Request a range yielding ≥220 bars (ideal for EMA200).Robinhood:get_equity_quotes→ live price / last session close.Robinhood:get_equity_positions(agent-tradable account) for size and P&L →--holding trueif there is a position,--holding falseif flat. The decision cascade differs between the two.
For the Macro-Sentiment pillar (once per session, shared):
get_equity_historicalsfor the 8 ETFs: SPY, RSP, IWM, HYG, LQD, TLT, XLY, XLP.- Attempt to fetch the 10Y-2Y yield spread from Investing.com (web) and inject it as
yield_spread. If blocked by network egress policy or unavailable, omit it:macro_pillar.pyautomatically redistributes its 20% weight among the other components.
For portfolio management:
Robinhood:get_portfolio→ market value and buying power.Robinhood:get_equity_positions→ open positions by account.Robinhood:get_realized_pnl→ realized P&L.
Computation Flow (Run via Code Execution)
Scripts are pure Python stdlib (3.9+); they do not require external network access or tzdata. They live in scripts/ inside this skill's directory. Run any script with no arguments to execute its self-test; a non-zero exit means do not trust its numbers this session.
Step 0 — prepare inputs (every session): Save the historicals and quotes responses to files, then:
It drops bars flagged interpolated: true (synthetic fill, e.g. the span before a recent IPO), appends today's last_trade_price from the broker's own dates (provisional during regular hours — label the scorecard intraday (partial bar) — final after 16:00 ET), excludes stale symbols, and writes ticker_<SYM>.json, macro_input.json and a report in closes.json. Report its warnings.
Step 1 — Macro (once per session):
To add the yield spread, insert "yield_spread" into macro_input.json first. Save pillar_score (-2..+2). That number is the Macro-Sentiment score for all tickers today.
Step 2 — Per ticker:
This returns the three-pillar scorecard and decision.
Three-Pillar Framework
Each pillar ranges from -2 to +2:
- Trend — EMA 20/50/200 structure + price position vs. EMAs + long-term slope.
- Momentum — Wilder's RSI-14 + MACD histogram + TRIX-15 vs. signal.
- Macro-Sentiment — from
macro_pillar.py(cross-asset regime).
Decisions:
- EXIT / TRIM: Bullish momentum exhausted (RSI turning from overbought, MACD histogram shrinking, price near upper Bollinger band).
- EXIT: Bearish momentum relentless (structural weakness, negative MACD histogram, falling TRIX).
- RE-ENTRY (new cycle): Flat account; rebound arrives with healthy EMA structure.
- TACTICAL REBOUND (counter-trend): Flat account; rebound appears within a death-cross: reduced size, close target, conditional exit on next session / daily close if rebound falters.
- HOLD (ride the cycle): Holding position with intact positive trend and momentum; maintain while watching for exhaustion.
- HOLD (under review): Holding position; weak signals or adverse momentum, prepare to exit if conditions degrade.
- WAIT (do not chase): Flat account; healthy trend but no fresh entry trigger.
- STAY OUT / AVOID: Flat account; relentless bearish trend, no rebound trigger.
- HOLD / OBSERVE or OBSERVE: Mixed signals; no clear trigger.
External Context (News + Analysts — Non-Blocking / Optional)
All external context is optional, best-effort, and non-blocking:
- News/macro: Investing.com (if available).
- Analyst ratings: Google Finance (if available).
- Network egress safety: If external web lookups fail, time out, or are blocked by network egress policies, skip them immediately and proceed with deterministic Robinhood data and local Python scripts.
- Report qualitative context alongside the three-pillar scorecard — it never alters numerical indicator scores.
Indicator Details
- EMA seed = SMA of the first N bars.
- RSI-14 with Wilder's smoothing.
- MACD 12/26/9; line, signal, histogram.
- TRIX-15 = % ROC of triple EMA, with EMA-9 signal.
- Bollinger Bands 20/2 with population standard deviation; report %B.
- Slopes are measured against 5 bars ago (
--slope-lookback).
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinggemini-spark/SKILL.md
Popularity
- Repository stars
- 289
- Repository forks
- 70
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/oft3r/agentic-trading-desk/gemini-spark)