This Chinese-language example describes an automated hedge between OKX and Binance perpetual futures. It reads signed position sizes and quotes from both venues, tracks progress toward a requested amount, and uses an opening spread threshold to trigger…
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
64 documents
This example describes a mean-reversion approach to the price spread between near- and far-month index futures contracts. On 15-minute bars, it calculates the difference between the contracts’ closing prices over an 80-bar window, then estimates the spread’s…
This script describes a two-exchange spot arbitrage process for the same asset. It compares executable bid and ask prices across venues, estimates available depth, and places paired buy and sell orders when the spread exceeds a threshold that includes…
This document describes an execution utility for opening, closing, or reversing positions in two perpetual futures contracts. When opening, it calculates each leg's quantity from a shared per-asset value and the current ticker price, with a contract-value…
This spread strategy uses Bollinger bands to enter positions when a spread moves beyond its recent range, then aims to close the position after it returns to its simple moving average. It updates spread bars from incoming ticks and waits for its price…
This example describes two triangular arbitrage directions across BTC/USDT, LTC/USDT, and LTC/BTC markets. It compares prices from the three tickers and estimates whether converting through the triangle could yield a positive return after applying a stated…
This document describes a read-only scanner for comparing perpetual futures funding rates across centralized and on-chain venues. It converts rates with different settlement intervals to annualized values and an equivalent eight-hour spread, then pairs the…
This document describes a charting script for tracking Brazilian real quoted crypto prices across BitcoinTrade and Binance. It plots BitcoinTrade bid and ask data for several assets, then compares corresponding BRL markets on both venues to visualize…
This bot monitors Bitcoin order books on two exchanges and opens paired trades when the bid on one venue exceeds the opposing ask on the other by a configurable spread threshold. It sells on the higher-priced venue and buys on the lower-priced venue,…
This controller coordinates cross-exchange market-making executors across a maker venue and a taker venue. Users configure separate buy and sell profitability targets with associated allocation weights. The controller divides its quote budget equally between…
The document describes a bot for 15-minute Polymarket BTC Up/Down contracts. It monitors both asks for a sharp fall in either side, then submits buy orders for that side and its opposite. The target is to keep the combined purchase cost below one USDC, so a…
The strategy constructs a Bitcoin futures-versus-spot spread from weighted prices across Binance and OKX, then standardizes that spread with a rolling mean and standard deviation to obtain a Z-score. It evaluates the signal across three configurable…
This document describes a monitor that samples prices from two exchanges and plots their difference over time. The operator can choose last-traded, bid, or ask prices independently for each venue, set polling and retry intervals, and optionally adjust…
This JavaScript strategy monitors order books on two exchanges for the same currency. It compares the best bid on one venue with the best ask on the other in both directions, then opens a paired short and long when the corresponding spread meets its…
This prototype outlines a statistical arbitrage strategy for the price spread between spot assets and delivery futures. It proposes running an Augmented Dickey–Fuller stationarity test hourly and allowing trades only when the spread passes a p-value…
This prototype describes a market-neutral approach to trading the spread between spot assets and dated futures. It proposes checking spread stationarity with an Augmented Dickey–Fuller test, then using a Z-score to identify unusually wide or narrow spreads.…
This document describes a polling tool for comparing prices from two exchanges, including spot and futures markets. Users can choose each market’s quote currency, futures contract and leverage settings, and whether to compare best ask, last price, or best…
This strategy trades a three-contract spread across a perpetual, current-quarter, and next-quarter Binance coin-margined futures contract. It defines the butterfly spread as next-quarter plus perpetual minus twice the current-quarter price. Long exposure to…
This example describes a futures spread strategy built around an estimated methanol-to-olefins production margin. It combines the values of polyethylene and polypropylene output with methanol input costs, scaling prices by contract multipliers and assumed…
This educational strategy monitors two spot exchanges for a price gap large enough to justify buying on one venue and selling on the other. The trigger can be set as an absolute price difference or a percentage of an average price derived from both books.…
The document proposes smoothing a transformed price series with an adaptive regularized moving average, then using crossings between that signal and price to switch between long and short positions. It describes a five-day window, adaptive weighting, and a…
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 framework trades the relative price of the PAXG and XAUT gold-linked tokens. It expresses their difference as a percentage, then estimates a rolling mean and standard deviation from minute closes. A spread beyond two standard deviations prompts a…
This teaching example describes a triangular hedge using ETH/BTC, ETH/USDT, and BTC/USDT markets. It compares the ETH/BTC quote on one venue with an implied ETH/BTC rate calculated from the other two pairs. When the difference exceeds a fixed threshold, it…