Strategy Code Breakdown
FreeA line-by-line walkthrough of all 8 strategies in the library: MACD, RSI, Golden Cross, Bollinger Squeeze, Bull Call Spread, Bear Put Spread, Cash-Secured Put, and Iron Condor. No hand-waving — every formula explained.
0 of 11 lessons complete
Lessons
MACD Momentum — Code Walkthrough
Read every line of the MACD strategy: EMA math, the MACD/signal/histogram pipeline, and how crossover signals are detected.
RSI Mean Reversion — Code Walkthrough
Walk through the RSI calculation step by step: first-pass averages, Wilder's smoothing, and the oversold/overbought signal logic.
Golden Cross — Code Walkthrough
Understand the SMA calculation, why 50/200 periods are used, and how the Golden Cross and Death Cross crossover signals are detected.
Bollinger Squeeze — Code Walkthrough
Understand how Bollinger Bands are constructed from standard deviation, what "bandwidth" means, and how the squeeze breakout signal is generated.
Bull Call Spread — Code Walkthrough
Walk through the CRR binomial tree pricing model, how Greeks are computed via finite differences, and how the spread P&L is assembled from two option legs.
Bear Put Spread — Code Walkthrough
Walk through the Python implementation: CRR put pricing, the spread assembly with two put legs, and how the P&L diagram is computed over a price range.
Cash-Secured Put — Code Walkthrough
Understand how CRR prices the sold put, what assignment probability means mathematically, and how annualized return on the collateral is calculated.
Iron Condor — Code Walkthrough
Walk through the four-legged options structure: how the call spread and put spread are combined, how breakevens are computed, and why net delta near zero is the goal.
How the Code Actually Picks the Stock
A line-by-line tour of the exact functions in engine.ts that decide which stock gets a buy signal on any given day — and which gets ignored.
How the Code Executes the Trade
Once a buy signal fires, exactly which lines open the position, deduct cash, calculate shares, and eventually close the trade — traced through simulateStrategy and closeTrade.
Bull Call Spread — Real-World Execution
Learn how to execute a bull call spread with actual options chain data: strike selection, bid-ask slippage, executability assessment, and practical order entry.