longbridgelongbridge
  • Platform Features
    Features
    Investment ProductsPrivate Wealth ManagementTrading ToolsMarket Data ServicesAnalysis ToolsNews ServicesFor Developers
    Account Types
    For IndividualsFor Institutions
  • Café
longbridge
© 2026 Longbridge|Terms of ServicePrivacy Policy
阿
阿特修罗Feed Explorer

Sep 9 at 12:17 PM

# 💡 Options too hard to understand? I built a beginner-friendly strategy recommender using "longbridgeAi + workbuddy" for everyone. Open source.

# 💡 Options too hard to understand? I built a beginner-friendly strategy recommender using "longbridgeAi + workbuddy" for everyone. Open source.

LongbridgeAII'm LongbridgeAI, I can summarize articles.
We Are Options Trader


@LongbridgeAI
> A full retrospective on how one person + AI spent half a day building an options strategy tool for US stocks

---

## 📌 The Origin: Options are Just Too Unfriendly to Beginners

What truly pushed me to build this tool was the **high barrier to entry of options themselves**:

- 🧠 **Obscure Concepts**: Calls, puts, ITM/OTM, intrinsic/time value, Greeks... a wall of jargon alone can scare off half the beginners;
- 🌀 **Complex Strategies**: Covered calls, cash-secured puts, bull call spreads, collars, iron condors... each name corresponds to a P&L diagram at expiration, leaving novices wondering, "Which one should I actually use for my situation?";
- 📐 **Interconnected Variables**: Strike price, expiration date, and implied volatility influence each other. Even reading introductory books causes dizziness, let alone simulating "what happens if it rises to X."

After finally getting past the initial hurdle, I got hit again by the "parameter checking" pain—opening five or six tabs just to copy data for a single ticker: current price, volatility, far-month option chains, institutional target prices, earnings dates, only to spend ages estimating returns in Excel. Meanwhile, existing Q&A tools only provide template responses. They **don't connect to my actual holdings or real-time data**, nor do they explain in plain language which strategy to choose.

So I decided: I'll build it myself. Input "Ticker + Holdings", and get direct answers—which strategy category to use, which expiration month to buy, approximate strike prices, expected ROI, and a clear explanation of why.

## 🛠️ The Process: Data Sources, Account Integration, and Three Major Pitfalls

**1) Lesson One on Data Sources: Don't Put All Your Eggs in One Basket**
I started with Yahoo/yfinance but got rate-limited immediately. Switching to the **CBOE official delayed feed** solved it: free, stable, and the delayed data is perfectly adequate for capturing option chains, volatility, and Greeks all at once.

**2) To Get "Real Parameters," You Must Connect to a Broker**
The biggest fear for a recommender system is fabricated parameters. So I integrated the **Longbridge LongPort Open Platform API**:
- 📄 Automatically reads my account's **actual holdings and USD cash balance** for that stock;
- 🎯 Pulls **broker consensus target prices** and the **earnings calendar**;
- No more manually typing in "I guess the stock hits 350."

**3) Didn't Want to Configure Env Vars in Terminal → Built as a Web Modal**
Added a "Connection Settings" button in the top-right corner of the webpage: enter the API Key for direct connection, or use **OAuth Account Authorization** (enter Client ID, automatically pops up the official auth link, login and consent completes the process, token SDK caches automatically). Now you can configure everything with a few clicks on the page without restarting the service.

**4) Three Pitfalls Stepped Into (Each One Resolved with AI's Help)**

| Pitfall | Symptom | Solution |
| --- |---| --- |
| 😵 SDK Auth Deadlocks Service | OAuthBuilder blocks the entire web service while waiting for authorization, causing page timeouts | Split auth into an **independent subprocess**. The main service polls via a state file. Tested: pages continue generating analysis normally during auth |
| 🔒 Can't Delete Self-Written Files on Windows | When clearing credentials, antivirus/handle locks the newly written file, though external deletion works | Changed to **"overwrite with empty + best-effort delete"**. Clear semantics no longer rely on physical deletion |
| 🪟 Browser Flooded with Popups | Frontend polling opens an auth page every 1.5 seconds, resulting in 9 consecutive popups | Added deduplication: "Only open one auth session per request" |

## ✅ Result: A One-Sentence Workflow

Enter `Ticker + Holdings 0` → Auto-read account & consensus targets → Instantly output "Single Strategy / Multi-Strategy Comparison" → Calculate returns & ROI based on expiry stock price → Export CSV/HTML report → Attach an **AI Plain-Language Interpretation** (compare against your target price, check capital usage, flag earnings windows).

Live Test: Page responded throughout; AAPL current price $316, far-month March 2027 chain data normal; Config → Auth → Read → Clear, the entire chain verified with clicks in the browser.

## 🤖 What Roles Did LongBridge and AI Play?

**Longbridge Open Platform = "The Real Data Layer"**
Replaced "my assumed holdings/target prices" with "actual holdings & cash in my account + institutional consensus + earnings dates." Without this layer, discussing capital usage or expiry ROI is like building castles in the air; with it, there's no need to switch between 5 windows every time.

**AI = "Dev + Debugging + Interpretation Layer"**
- End-to-end from requirements to code: algorithms, web UI, APIs, and auth state machines were all written through natural language conversations;
- The three platform-level pitfalls above (thread deadlock / file lock / popup storm) were all resolved step-by-step by AI identifying root causes, providing solutions, and verifying fixes;
- The "AI Strategy Interpretation" on the running page cross-references market data, holdings, target prices, earnings, and capital info into **understandable plain language**, rather than just dumping a Greek letter table on you.

In short: **Longbridge handles "Reality," AI handles "Convenience;" Real parameters + understandable conclusions make a usable tool.**

## ⚠️ A Final Honest Word

This tool is for learning and research purposes only, **not investment advice**. Options have high leverage and risk; beginners must verify using paper trading and disposable income. Data interfaces come from CBOE delayed feeds and the LongPort Open Platform (official docs are detailed), and the code is fully stored locally for repeated modification.
Open Source Link: https://github.com/weiyuan0917-a11y/us-options-advisor
> If you want to do something, do it yourself — this is the most worthwhile "investment" of the year. 💪

$Invesco QQQ Trust(QQQ.US)

Apple

Apple

USAAPL

Invesco QQQ Trust

Invesco QQQ Trust

USQQQ

The copyright of this article belongs to the original author/organization.

The views expressed herein are solely those of the author and do not reflect the stance of the platform. The content is intended for investment reference purposes only and shall not be considered as investment advice. Please contact us if you have any questions or suggestions regarding the content services provided by the platform.

LongbridgeAI