Designing an Equal-Spaced Spot Grid with Price-Crossing Rules
Summary
This beginner tutorial outlines how to build a simple spot grid strategy for a cryptocurrency pair. It begins by defining the intended behavior: use equally spaced price levels around a starting point, allow the grid to extend in both directions, and place market orders. It then represents each level with a price and buy and sell flags, generating a set of levels above and below the starting price while excluding nonpositive prices. The trading logic identifies a crossing by comparing prices at successive observations: moving above a level can trigger a sale, while moving below can trigger a purchase. The tutorial notes that repeated crossings at one level should not create repeated trades and introduces the flags as a way to track whether a level has already acted, though the follow-up issue is expected to explain the full conditions. The example illustrates the data structure and crossing concept, but supplies no backtest results, fee model, sizing rules, or treatment of slippage. Its infinite-grid framing also leaves inventory and capital limits unresolved.
Key ideas
- An equal-spaced grid can be represented as ordered price levels above and below a starting price.
- Each level can store buy and sell state so the strategy can track actions taken at that level.
- A crossing is detected by comparing prices from successive observations against a grid level.
- Crossings below a level indicate a buy opportunity, while crossings above indicate a sell opportunity in the described logic.
- The tutorial introduces repeated-trade prevention but leaves the complete trigger rules and risk controls for later discussion.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.