Skip to main content
Glama
staskh

trading-skills

by staskh

ib_0dte_ema_vix

Find (and optionally place) the best 0DTE credit spread via the EMA + VIX/VXN strategy.

Instructions

Find (and optionally place) the best 0DTE credit spread via the EMA + VIX/VXN strategy.

Reads 30-min IB bars + the live vol index, applies the vol gate, then auto-selects bull_put or bear_call from the EMA9/EMA21 cross before ranking spreads. NDX/QQQ are gated on VXN (Nasdaq-100 vol); all other symbols on VIX. Returns success=False with a reason when a gate blocks the trade (VIX-SKIP / no-cross / EMA-Dn-no-RR / missing-bars).

Default is a bare EMA cross runnable any time of day; enable the optional confirmation gates per call. Default is a dry run — pass execute=True to place a live combo order with the automatic OCA exit bracket. Requires TWS or IB Gateway running locally.

Args: symbol: Underlying (e.g. NDX, SPX, RUT, QQQ, SPY) budget: Max capital at risk in dollars (default 50000) port: IB port (7496 for live, 7497 for paper) vix_threshold: Skip if vol index >= this. Default is per-index: VXN 35 for NDX/QQQ, VIX 20 otherwise. target_delta: Short-leg delta target (default 0.12) rr_gate: Require red→red (9:30 + 10:00 ET bars both red) to confirm a Bear Call time_gate: Require today's 9:30 + 10:00 ET bars (run at 10:30 ET+) and anchor the EMA-cross lookback to the 10:00 ET bar max_width: Cap the strike width in dollars (NDX typically 100) gex: Compute the dealer gamma-exposure profile top: Number of candidates to return (default 5) account: IBKR account for execution (required with execute when >1 managed account) execute: Place the chosen spread as a live combo order (default False = dry run) pick: 1-based rank of the candidate to execute (default 1 = best) limit_frac: Walk between the marketable combo credit (0) and mid (1.0) at execution

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gexNo
topNo
pickNo
portNo
budgetNo
symbolYes
accountNo
executeNo
rr_gateNo
max_widthNo
time_gateNo
limit_fracNo
target_deltaNo
vix_thresholdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.18.1

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations present, the description carries the full burden—and it delivers. It discloses reads of 30-min IB bars and the vol index, the gate logic, per-index VIX/VXN handling, failure return reasons, the dry-run default, and that execute=True places a live order with an OCA exit bracket. This is unusually transparent about side effects and prerequisites.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense but well-organized: a clear one-sentence summary, a behavior paragraph, defaults/prerequisites, then a complete Args list. Every sentence adds necessary information, and the length is justified by the 14 parameters and the complex execution behavior.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 14-parameter tool with no output schema and no annotations, the description is unusually complete. It covers input requirements, execution mode, risk gates, failure conditions, and system prerequisites. The success-path return shape is implicit via 'top' and 'pick', but the agent has everything needed to select and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so every parameter's meaning must come from the description. It does: all 14 args are explained with defaults, ranges, real-world examples (NDX typically 100, VXN 35 for NDX/QQQ, port 7496 vs 7497), and execution semantics like limit_frac and pick. The description fully compensates for the schema's lack of parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence states a specific verb and resource: 'Find (and optionally place) the best 0DTE credit spread via the EMA + VIX/VXN strategy.' It clearly identifies the strategy, asset type, and action, and the strategy-specific wording differentiates it from generic spread tools like spread_vertical or ib_option_chain.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly explains the two modes: default dry run vs. execute=True for a live combo order, and notes the requirement for TWS/IB Gateway running locally. It gives strong context on when optional gates (rr_gate, time_gate) can be enabled, but it does not explicitly name sibling alternatives or state 'use this instead of X'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.