This implementation models a spread as a collection of instrument legs, with separate multipliers for calculating its quoted price and translating spread quantities into leg quantities. It combines leg bid and ask prices, reversing which side is used for…
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
71 documents
The document is a historical series of hourly candlestick observations for a BCH/USDT market. Each row records a timestamp, open, high, low, close, and traded volume, giving the basic inputs commonly used to inspect price movement, calculate technical…
The document introduces a position calculator for a grid strategy that tracks net quantity, average price, and accumulated profit as fully filled orders arrive. Its example illustrates that after buying at several nearby levels and selling part of the…
This document compares crypto spot, leveraged spot, and futures trading. It explains that spot positions are not subject to liquidation in the described framework, while borrowed margin positions and futures can be forcibly closed. It outlines long and short…
This document describes a software interface for spot trading. It provides methods for placing limit and market buy or sell orders, checking balances and order status, canceling orders, and retrieving ticker, candle, and order book data. The order wrapper…
This introduction explains Python modules as reusable files, distinguishes modules from packages and libraries, and shows how to import whole modules, selected names, or aliases. It also covers installing third-party packages and using the main-module guard…
This example demonstrates a workflow for analyzing Bitcoin market data across multiple time intervals. It loads minute bars for a specified historical period, configures a transaction-rate assumption, and selects several technical indicators, including ATR,…
The document contains historical ADA/USDT candlestick observations at half-hour intervals. Each row records a timestamp, open, high, low, close, and traded volume, allowing a researcher to inspect price movement and activity or use the series as an input to…
The strategy compares the current marked value of its position with a stored balance amount on each new bar. When the relative difference reaches a configurable threshold, it trades toward balance: it buys when the stored amount exceeds position value and…
This strategy uses a fast and a slow moving average to trade a cryptocurrency futures contract. A bullish crossover opens a long position or reverses a short position; a bearish crossover opens short or reverses long. Signals use earlier completed bars…
This document implements a directional crossover strategy using fast and slow exponential moving averages on hourly bars. It calculates the averages from closing prices, discards the latest bar if it has not yet closed, and signals a long position when the…
The document outlines an event-driven trading system designed for cryptocurrency strategies, including market making and higher-frequency activity. It describes an asynchronous event loop for processing work and a message queue that connects separate market…
This guide explains how to use a Python wrapper around multiple cryptocurrency exchanges through a mostly consistent interface. It shows initialization with an exchange name and credentials, then describes calls for market status, candlesticks, order books,…
This example retrieves historical minute bars for a cryptocurrency symbol from a trading database, using an exchange, interval, and date range as query parameters. It then extracts each bar’s timestamp and closing price and plots the resulting price series…
This lesson explains how Python functions return values and how that differs from printing output. It covers explicit returns, the implicit None result when no value is returned, how a return ends the current function, and how multiple returned elements are…
This document is a daily candlestick dataset for the BTC/USDT market during 2019. Each row records a timestamp and the open, high, low, and close prices, together with traded volume. The visible entries span portions of the year, including early-year…
The document contains hourly open, high, low, close, and volume observations for the ADA-USDT market. The visible records begin in early May 2018 and continue through the end of December 2018, with gaps in the displayed sequence. The fields support basic…
This strategy seeks directional breakouts on one-hour bars. A long entry requires positive CCI and an intraday bid above the upper Bollinger Band and the previous bar’s high; a short entry requires negative CCI and an ask below the lower band and previous…
This example outlines a multi-timeframe analysis workflow for Bitcoin-dollar price data. It loads minute history over a stated date range, configures a transaction-rate assumption and a rolling analysis window, and assigns technical indicators to several…
The document describes a graphical workflow for downloading historical bars, configuring a CTA strategy backtest, reviewing performance statistics, and inspecting trades on a candlestick chart. Data can come from a domestic market data service, an…
The document walks through preparing a Python environment, installing a trading framework, and launching its graphical interface. The example registers exchange gateways and applications for strategy execution, historical data recording, risk controls,…
This document provides four-hour candlestick observations for BSV/USDT. Each entry records a timestamp, open, high, low, close, and volume. The series shown runs from late November through the end of December 2018 and offers a coarser view of price movement…
This document presents 30-minute candlestick observations for BSV/USDT, with timestamps and open, high, low, close, and volume fields. The visible sample starts at the end of November 2018, includes records from early December, then skips ahead to late…
This document contains 30-minute candlestick records for BIX/USDT. Each row reports a timestamp, open, high, low, close, and trading volume. The visible records begin in July 2018 and resume near the end of December after an omitted portion, so they provide…