Version: 1.0
Develop a production-quality Python application that scans the SPX/SPXW option chain in real time and notifies the user only when a high-quality 0DTE Bull Put Spread opportunity exists.
This application DOES NOT place trades.
Its only responsibility is:
- Scan market
- Score trades
- Send alerts
The application must be modular, configurable and production ready.
- Clean Architecture
- SOLID principles
- Fully typed Python
- Unit tested
- Docker compatible
- Easy to extend
- Provider independent
The data provider should be replaceable without changing business logic.
Python 3.12+
spx_trader/
app.py
config/
config.yaml
logging.yaml
data/
provider.py
longbridge_provider.py
tradier_provider.py
mock_provider.py
market/
market_regime.py
support_resistance.py
breadth.py
vix.py
indicators/
ema.py
atr.py
vwap.py
rsi.py
options/
option_chain.py
spread_builder.py
greeks.py
scoring/
trade_score.py
scoring_engine.py
alerts/
telegram.py
discord.py
email.py
dashboard/
dashboard.py
utils/
logger.py
time.py
models/
option.py
spread.py
market.py
signal.py
tests/
Use dependency injection.
Never instantiate providers directly.
Everything depends upon interfaces.
Example
MarketScanner
↓
IDataProvider
↓
LongbridgeProvider
pandas
numpy
pandas-ta
httpx
pydantic
apscheduler
pyyaml
rich
loguru
python-dotenv
pytest
Must expose
get_spx_quote()
get_vix()
get_option_chain(expiration)
get_market_breadth()
get_intraday_bars()
Calculate
20 EMA
50 EMA
VWAP
ATR
Trend
Expected Move
Score:
0-25
Use
VIX
Expected Move
IV
IV Percentile (if available)
Score
0-15
Scan entire chain.
Reject
Low Open Interest
Wide Bid Ask
Poor liquidity
Find
Delta
0.08-0.15
Default
10 point width
Allow
5
10
15
20
point widths.
Reject trades if
SPX below VWAP
Trend bearish
VIX below threshold
Major economic event
Poor liquidity
Late afternoon (configurable)
Maximum
100
Trend
25
Volatility
15
Option Premium
20
Support Distance
15
Liquidity
10
Time
5
Risk Events
10
Only alert
Score >= 90
Display
Market Regime
Trend
VIX
Expected Move
Best Strategy
Recommended Delta
Trade Score
Recommended Spread
Use Rich library.
Telegram
Discord
Message example
🔥 SPX Opportunity
Score 94
Sell
6450P
Buy
6440P
Credit
1.45
POP
89%
Delta
0.11
Reason
Trend
VWAP
Support
Premium
Run every
60 seconds
Configurable.
Everything configurable.
Never hardcode.
Use YAML.
Examples
EMA lengths
Delta range
Credit minimum
Alert threshold
Trading hours
Spread width
VIX thresholds
Loguru
Daily rotating logs.
Separate
errors
alerts
scanner
Retry network requests.
Exponential backoff.
Graceful shutdown.
Never crash because provider unavailable.
Unit tests
Provider mocks
Scoring tests
Alert tests
Dashboard tests
Minimum
80% coverage
Machine Learning score
Kelly sizing
Iron Condor
Bear Call Spread
Backtesting
Trade Journal
Performance Analytics
Expected Move prediction
Gamma Exposure
Market Breadth
SPY correlation
PEP8
Type hints everywhere
No global variables
No duplicated logic
No magic numbers
Dependency injection
Small functions
Single responsibility
The coding agent shall generate
Complete project
Dockerfile
docker-compose.yml
requirements.txt
README.md
.env.example
Sample config.yaml
Complete tests
Example Telegram configuration
Mock provider
Working dashboard
Working scheduler
Production-ready logging
No placeholder files.
The application should run immediately after adding API credentials.