ib_0dte

Featured

Find and place the best 0DTE (zero-days-to-expiration) credit spreads from Interactive Brokers. Default execution route is the EMA9/EMA21 + VIX/VXN regime strategy (ema_vix_0dte.py), which auto-selects bull_put or bear_call from a bare EMA cross and skips the trade when the vol index is elevated (VXN ≥ 35 for NDX/QQQ, VIX ≥ 20 otherwise). Optional --rr-gate and --time-gate add red→red and bar-timing confirmation. Supports cash-settled indices (SPX, NDX, RUT, VIX) and any optionable stock/ETF. Manual spread type override is available via zero_dte.py. Requires TWS or IB Gateway running locally.

AI & Automation 371 stars 85 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 88/100

Stars 20%
86
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# IB 0DTE Credit Spread Finder & Executor **Default execution route: `ema_vix_0dte.py`** — the EMA9/EMA21 + VIX/VXN regime strategy. It reads the 30-min IB bars, checks the vol index (VXN ≥ 35 for NDX/QQQ, VIX ≥ 20 otherwise), and auto-selects `bull_put` or `bear_call` from a bare EMA cross (or skips entirely) before delegating to the spread finder. Optional `--rr-gate` and `--time-gate` add confirmation. Use this unless the user explicitly requests a manual spread type. `zero_dte.py` is the manual override when the user specifies `--type bear_call`, `--type bull_put`, or `--type iron_condor` directly. Both scripts share the same spread-finding engine (find → propose → execute on `--execute`) and all the same flags. All data comes from IBKR. Supports cash-settled indices (**SPX, NDX, RUT, VIX, XSP, DJX**) — which trade as `Index` contracts on their home exchange — as well as any optionable stock or ETF. ## Prerequisites TWS or IB Gateway running locally with the API enabled: - Paper trading: port 7497 (default) - Live trading: port 7496 Index options require the appropriate **index-options market-data entitlement** (separate from equity/ETF data). Without it, index quotes will not populate. ## Instructions ### EMA + VIX/VXN Strategy (recommended — fully automatic signal) The script checks the vol index, reads the 30-min bars, determines bull_put vs bear_call from the EMA9/EMA21 cross, then calls the spread finder automatically. By **default it runs a bare EMA cross ...

Details

Author
staskh
Repository
staskh/trading_skills
Created
7 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

broker-execution-apis

Connect to a broker and place orders without accidentally trading live money. TRIGGER - connect to Interactive Brokers, TWS, IB Gateway, ib_async, ib_insync, ibapi, Alpaca, Schwab, schwab-py, Tastytrade, Tradier or Robinhood; place, modify or cancel an order; read positions or balances; set up paper trading; order types, time-in-force, bracket or OCO orders, client order ID; FIX, quickfix, simplefix; "make sure I don't send a live order"; a broker connection being refused. Load before any code that can transmit an order. SKIP for crypto exchanges and ccxt (crypto-data-and-execution), and for vnpy, CTP, QMT or any Chinese broker gateway (china-trading-stack). This skill answers TWS/Gateway port and connection failures on its own - the fin-libraries deep dive is optional and most installs will not have it.

1 Updated today
howard-lynn-ye
AI & Automation Listed

trade-options

Options Strategy Advisor — analyzes implied volatility, IV rank/percentile, expected moves, put/call ratios, max pain, unusual activity, and recommends specific options strategies with risk/reward profiles based on the trader's directional outlook.

0 Updated 1 months ago
Serennity007
AI & Automation Listed

lib-ib-async

The maintained Interactive Brokers Python client - successor to the archived ib_insync - where one digit of the port number is all that separates paper from live. TRIGGER - import ib_async, from ib_async import IB, pip install ib_async, ib.connect, clientId, ports 7496 7497 4001 4002, TWS, IB Gateway, reqHistoricalData, reqMktData, reqTickersAsync, placeOrder, managedAccounts, reqPositions, reqOpenOrders, reqExecutions, Master Client ID, Read-Only API, orderRef, ibflex, ibapi, ib_insync; "Enable ActiveX and Socket Clients", pacing violations, error 1102, a DU or U account prefix. Memory is stale here: ib_insync was archived 2024-03-14 after its author died, ib_async 2.1.0 (2025-12-08) is the successor and does not wrap ibapi, its main branch has been static about nine months, and ib_fut does not exist. SKIP for non-IB brokers and for the general order-safety patterns (broker-execution-apis). SKIP for choosing between libraries, or when no library is named - the domain skill's job.

1 Updated today
howard-lynn-ye