Option Trading Analyzer (prototype)
Overview
- Minimal prototype: FastAPI backend + simple static frontend to call analysis endpoint.
Run backend (Windows PowerShell):
python -m venv venv
venv\Scripts\Activate.ps1
pip install -r backend/requirements.txt
uvicorn app.main:app --reload --port 8000 --app-dir backendOpen the frontend by opening frontend/index.html in a browser and click "Run Analysis". The front-end will call http://localhost:8000/analyze.
Next steps you can ask me to do:
- Integrate real market data (Webull/Robinhood connectors) or a market data provider.
- Improve the analysis engine (add ATR, MACD, IV rank handling).
- Build a React UI with charts and options chain table.
- Add authentication and brokerage order routing.
- The launchable frontend is now in
frontend/app/. - Copy
frontend/app/.env.exampletofrontend/app/.envif you want to change the backend URL.
Run the full app:
python -m venv venv
venv\Scripts\Activate.ps1
pip install -r backend/requirements.txt
cd frontend/app
npm install
npm run dev- Backend runs on
http://localhost:8000 - Frontend runs on
http://localhost:5173 - The app fetches
/provider-dataand/analyze, then renders the dashboard, chart, trade ticket, and options chain.
Use only free tiers:
- Frontend: GitHub Pages via
.github/workflows/deploy-frontend.yml - Backend: Render free web service via
render.yaml
How to test online without spending money:
- Push the repo to GitHub.
- Enable GitHub Pages in repo settings after the workflow runs.
- Deploy the backend on Render using
render.yaml. - Set the frontend secret
VITE_API_URLto your Render backend URL, for examplehttps://your-app.onrender.com.
If you skip step 4, the frontend still opens in demo mode using fallback data, so you can test the UI for free even before the backend is live.
- Run
start-all.ps1from the repo root to start both backend and frontend in separate PowerShell windows. - Run
backend/run.ps1if you only want the API.
.\start-all.ps1- Configuration
- Copy
backend/.env.exampletobackend/.envand populate credentials for Webull or Robinhood if you plan to use them. SetDATA_PROVIDERtomock,webull, orrobinhood.
- Connector templates
- Connector templates are in
backend/app/connectors/:market_provider.py— abstract interfacemock_provider.py— in-repo mock provider returning sample candles/options/newswebull_connector.py— template to implement Webull API calls (requires adding auth logic)robinhood_connector.py— template to implement Robinhood API calls
- Using the mock provider (quick start)
- The backend already works with the mock provider. It returns realistic-looking sample candles and an options chain so you can develop UI and the analysis engine without API keys.
- Next steps to enable real providers
- Obtain API access or credentials for the broker/data vendor (Webull/Robinhood or a market-data provider).
- Implement authentication flows (token exchange, refresh) and the request wrappers in the corresponding connector file.
- Normalize provider responses to the input schema expected by
analyze(seebackend/app/schemas.py). - For safety, never commit credentials to the repo; use environment variables or a secrets manager.
If you want, I can implement the full Webull or Robinhood integration (I will need the API spec or your permission to use credentials locally). Alternatively I can wire a public market-data provider (IEX, Polygon, Tradier) — tell me which one you prefer.
- A mock provider test UI is available at
frontend/mock_test.html. It calls/provider-datato fetch normalized mock data. - Example sample input and response are under
backend/mock_data/.