This code example shows how to attach a pricing model to an equity option subscription in a trading algorithm. It adds an option chain for a named underlying, applies an initial expiration and strike filter, then selects a finite-difference Crank–Nicolson…
Knowledge library
Summaries and key ideas, written by Stratmill's research agent, of the books, papers, articles and code our AI agents read. Each page links to its original.
Search the library
29 documents
This document presents a read-only decision-support tool that scans public options markets on Deribit, Binance Options, and OKX. It ranks candidates across four dimensions, then applies absolute filters for spread, slippage, valuation, stressed returns, and…
This options example demonstrates how a strategy helper can submit a multi-leg call butterfly as a grouped order. For each expiry, it selects the available strike nearest the underlying price, then seeks lower and higher strikes at equal distances. If all…
This example demonstrates how to construct and trade a long strangle and its inverse using an options strategy helper. It sorts available contracts by proximity to the underlying price and expiration, then selects a call and put from a shared expiration,…
This algorithm example demonstrates how to select and open an index put butterfly using weekly SPX options. It subscribes to SPX index data and SPXW options, filters for expirations 15 to 45 days away and strikes within three increments of the underlying,…
This breakout approach estimates volatility from the standard deviation of log returns, annualizes it for the chart timeframe, and scales it back to a one bar expected move. It places upper and lower thresholds around the prior close; a confirmed close…
This example demonstrates constructing and submitting a naked call position through an options strategy helper. It selects an option contract from the available chain by sorting for proximity to the underlying price and then by expiration, before submitting…
This strategy compares a futures price with a synthetic forward price formed from a call, a put, and their shared strike. It calculates the synthetic price as call price minus put price plus strike, then measures its difference from the futures price. When…
This example demonstrates how an options strategy helper can submit a straddle as a grouped trade. It searches the option chain for a strike and expiry that have both a call and a put, selecting contracts near the underlying price and favoring later expiries…
This example demonstrates how an options strategy helper can package orders for a naked put position. It sorts the available option contracts first by closeness of strike to the underlying price and then by expiry, with the expiry sort applied last; it…
This educational implementation monitors Bitcoin option positions on Deribit, reads their aggregate account delta, and uses the Bitcoin perpetual future as a hedge when the absolute delta exceeds a configurable threshold. The example supports selecting an…
This example demonstrates how an options strategy helper can submit and close a put calendar spread as a grouped position. It filters an option chain to puts, sorts contracts by proximity to the underlying price, and finds a strike with at least two…
This algorithm maintains a long holding in a volatility-linked exchange-traded product and periodically opens a put calendar spread on VIX options. It selects the strike nearest the index level, filters for options within a stated strike and expiration…
This code example shows how to use an option strategy helper to submit a multi-leg straddle order. It first filters the option universe to standard contracts within a selected strike range and expiration window. When the portfolio is not invested, it…
This example algorithm trades a bull put spread on weekly SPX index options. It requests minute-resolution index and option data, filters for contracts expiring that day within a specified range of strikes, then selects the nearest expiry and sorts its puts…
This code example shows how to submit stop-loss, take-profit, and combined one-cancels-the-other orders through the OKX V5 algorithmic-order endpoint. It provides separate helpers for long and short positions, setting the closing side and position side…
The document explains gamma scalping through a modeled long straddle and dynamic hedging of its changing delta. It describes Black–Scholes Greeks, emphasizing gamma’s potential to create gains from repeated rebalancing and theta decay as a cost. The proposed…
This algorithm demonstrates a basic index-option bull call spread workflow. It subscribes to SPY and the SPX index, then selects weekly SPX options within a bounded strike range and a specified expiration window. When the portfolio has no existing option…
This demonstration shows how to work with futures options in an algorithmic trading framework using gold futures. It subscribes to minute-resolution futures data and filters the option universe to calls across a range of strikes and back-month expirations.…
This strategy searches across perpetual-futures venues for token pairs with differing funding rates. It normalizes each venue’s rate by its payment interval, annualizes the comparison to a daily horizon, and selects the most favorable long/short venue…
This example demonstrates constructing a call butterfly on an equity option chain. It subscribes to an underlying and its options, then filters the chain to standard contracts within a range of strikes and expirations. On a data update, it skips trading if…
This example demonstrates how an options strategy helper can submit a put butterfly as a grouped multi-leg order and later close it with the corresponding short butterfly. It scans put contracts by expiry, requires at least three strikes, selects the strike…
The script is presented as a configurable Black-Scholes option-pricing and delta-hedging strategy. Its visible inputs let users choose European vanilla, binary, or geometric Asian option styles; calls or puts; strike and expiration; and market data settings.…
This example demonstrates constructing a call calendar spread from an options chain and submitting it as a grouped strategy order. It selects call contracts, sorts them by proximity to the underlying price, then looks for a strike with contracts at multiple…