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…
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
12 documents
This strategy starts by placing buy and sell limit orders around the best bid, then follows whichever side fills. After a fill, it cancels opposing and profit-taking orders and adds another same-direction order at a wider, position-dependent grid interval.…
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…
The document defines common records used to represent ticks, bars, orders, fills, positions, accounts, contracts, and trading requests. Fields capture instrument identity, exchange, time, prices, volumes, order state, and selected contract properties.…
This guide explains execution algorithms that divide large orders, react to market prices, and adjust positions on a grid or across a spread. It describes time-weighted execution, iceberg orders, a tick-driven sniper approach, conditional orders, and…
This implementation describes a two-sided spot grid. It tracks buy and sell limit orders, checks their exchange status, and, when one fills, places a replacement order on the other side at a configured percentage gap. It rounds prices and quantities to…
This guide describes configuring and running an automated cryptocurrency grid trader for spot or futures markets. Its settings include the trading pair, percentage spacing between grid levels, per-order quantity, price and quantity precision constraints, and…
This example describes a two-sided grid for a futures market. It tracks open buy and sell limit orders, checks their statuses, and after a fill places a replacement order on the opposite side at a configured percentage gap. It also maintains another order…
This example implements a spot grid that keeps one buy and one sell order working around the latest top of book. At timed intervals, when neither side has an outstanding order, it places orders offset from the best bid and ask by half the configured grid…
This strategy places paired long and short limit orders around the market, then rebuilds the grid after fills using the last filled price and a position-dependent step. It tracks net position and average entry price with a grid position calculator. When…
The document describes a two-sided futures grid strategy that places orders on both sides of the market and includes take-profit and stop-loss controls. It presents the approach as most suitable for range-bound conditions or periods of relatively low, stable…
This spot grid strategy places paired buy and sell orders around the market, then rebuilds the grid after a fill using the filled order price and current bid and ask. Grid spacing and order size are configurable. A position calculator tracks net exposure and…