Grid
HyperliquidRangingPerpetuals (leverage/short)Lower riskeven grid in a range: add a step on each drop, trim on each rise
Track record
Return
+1.6%
Sharpe
1.64
Max DD
0.4%
AUM
$0
Created
2026-06-13
Investors
0
Pools
0
Settled days
0
Market fit
RangingSideways, mean-reverting price action- ✓Buys low / sells high while price oscillates around a mean
- ⚠Averaging against a strong one-way trend can draw down hard
Backtest (deterministic simulator)
Parameters: grid_pct / levels / unitBacktest curve is an example on a deterministic simulated price path — not real returns.
Core source
Source on GitHub ↗"""网格(Grid trading)—— 区间等距加减仓。
思路:以起始价为参考,价格每下跌一个网格步长就加一格仓位、每回升一格就减一格,库存随下跌线性累积
(0..levels 格),在震荡区间内低买高卖。本 demo 为长仓网格;参数 grid_pct(格距%)、levels(格数)、
unit(每格数量)。适合区间震荡;单边下跌会满仓套牢,故设 levels 上限作为风控。
"""
from __future__ import annotations
from ..base import StrategyBase
from ..context import StrategyContext
from ..registry import register
@register("网格")
class Grid(StrategyBase):
description = "区间等距网格:每跌一格加仓、每涨一格减仓(长仓)。"
params = {"grid_pct": 0.01, "levels": 6, "unit": 1.0}
def __init__(self, grid_pct: float = 0.01, levels: int = 6, unit: float = 1.0) -> None:
self.grid_pct = float(grid_pct)
self.levels = int(levels)
self.unit = float(unit)
self.ref: float | None = None
async def on_start(self, ctx: StrategyContext) -> None:
self.ref = await ctx.price(ctx.conn_symbol())
async def on_tick(self, ctx: StrategyContext) -> None:
sym = ctx.conn_symbol()
px = await ctx.price(sym)
if self.ref is None or self.ref == 0:
self.ref = px
return
step = self.ref * self.grid_pct
if step <= 0:
return
# how many grid steps below the reference (clamped to [0, levels])
n = int(max(0, min(self.levels, (self.ref - px) // step + (1 if px < self.ref else 0))))
await ctx.target(sym, n * self.unit, band=self.unit * 0.5)
The full SDK and all strategies are MIT-licensed open source — backtest, paper-trade, or fork them directly.
Pools running this strategy
No pools are running this strategy yet — be the first to launch one.