Grid Trading logo

Grid Trading

Organization
Superior-Trade
grid-trading

Use when writing a profit-laddered position-adjustment strategy on Superior Trade — anything described as a grid bot, range fade, range harvest, ladder buy, scaling-in, pyramiding, or "buy more when it dips and sell partials when it rallies". Note this is a profit-driven ladder, not a true 20-rung order-book grid; explain that limitation when the user asks for true grid trading.

Overview

PublisherSuperior-Trade
Repositorysuperior-skills
Skill namegrid-trading
Stars
215
Forks
9
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by Superior-Trade on GitHub. Read the source before you install it.

Installation

Install the Grid Trading AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Superior-Trade/superior-skills/tree/main/skills/grid-trading
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Superior-Trade/superior-skills.git /tmp/superior-skills
mkdir -p .claude/skills
cp -r /tmp/superior-skills/skills/grid-trading .claude/skills/grid-trading
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Grid Trading in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Grid Trading on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Grid Trading is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Strategy: Grid · Range Fade (laddered)

When to use

A user asks for "grid trading", "grid bot", "range fade", "ladder buy", "scale into the dip", "pyramid into a position", "DCA on drawdown" (not on calendar — that's strategy-dca-weekly). Anything where the trigger to add is a price drawdown, and there are partial take-profits on the way up.

Important caveat — explain this upfront

Freqtrade is a one-trade-per-pair engine. A real 20-rung grid bot — placing 20 limit orders simultaneously on the order book and refilling each as it fills — is not possible without engine changes. What you can implement is a profit-laddered position adjustment:

  • 1 initial entry at a trigger price
  • Up to N additional entries, each at a deeper drawdown step (−1%, −2%, …)
  • Partial take-profits at progressive profit steps (+1.5%, +3%, +4.5%, …)
  • Hard exit on a band breakout

This is a working, profitable approximation of the spirit of grid trading. If the user explicitly wants 100s of small fills per day on a tight book, say so and recommend running a separate grid runtime alongside Freqtrade.

Backtest reference

WindowETH/USDC 15m, 2026-03-01 → 2026-05-01 (61 days)
Trades4
Win rate100%
Wallet PnL+0.66% / +$65.58
Sharpe2.02
Profit per trade$15-30
Avg holding14 days
Max DD0% (intraday only)
Backtest ID01kqyz25d0zrwwf5fzccjk44dk

Order pattern per trade: 2 entries ("" initial + grid_buy_1) + 4 partial exits at grid_tp_* tags. Sparse — 4 trades over 61 days — because the 24h VWAP −1% trigger fires rarely on ETH. Tighten the trigger (e.g. vwap × 0.995) for more activity.

Reference implementation

python
from freqtrade.strategy import IStrategy
from freqtrade.persistence import Trade
from datetime import datetime
import pandas as pd


class EthGridStrategy(IStrategy):
    minimal_roi = {"0": 100.0}   # never auto-close on ROI; partials handled in adjust_trade_position
    stoploss = -0.30             # safety net, deeper than the deepest ladder rung
    trailing_stop = False
    timeframe = "15m"
    process_only_new_candles = True
    startup_candle_count = 200
    can_short = False

    position_adjustment_enable = True
    max_entry_position_adjustment = 5   # 5 ladder rungs below entry
    max_dca_multiplier = 6.0            # 1 + 5 adds

    def populate_indicators(self, dataframe: pd.DataFrame, metadata: dict) -> pd.DataFrame:
        # 24h VWAP on 15m bars (96 bars).
        tp = (dataframe["high"] + dataframe["low"] + dataframe["close"]) / 3.0
        pv = tp * dataframe["volume"]
        dataframe["vwap_24h"] = (
            pv.rolling(96).sum() / dataframe["volume"].rolling(96).sum()
        )
        return dataframe

    def populate_entry_trend(self, dataframe: pd.DataFrame, metadata: dict) -> pd.DataFrame:
        # First grid rung: 1% below 24h VWAP.
        dataframe.loc[
            (dataframe["close"] <= dataframe["vwap_24h"] * 0.99)
            & (dataframe["volume"] > 0),
            "enter_long",
        ] = 1
        return dataframe

    def populate_exit_trend(self, dataframe: pd.DataFrame, metadata: dict) -> pd.DataFrame:
        # Hard close on band breakout up.
        dataframe.loc[
            dataframe["close"] >= dataframe["vwap_24h"] * 1.06,
            "exit_long",
        ] = 1
        return dataframe

    def custom_stake_amount(self, pair: str, current_time: datetime, current_rate: float,
                            proposed_stake: float, min_stake, max_stake: float,
                            leverage: float, entry_tag, side: str, **kwargs) -> float:
        return proposed_stake / self.max_dca_multiplier

    def adjust_trade_position(self, trade: Trade, current_time: datetime,
                              current_rate: float, current_profit: float,
                              min_stake, max_stake: float,
                              current_entry_rate: float, current_exit_rate: float,
                              current_entry_profit: float, current_exit_profit: float,
                              **kwargs):
        if trade.has_open_orders:
            return None
        n_entries = trade.nr_of_successful_entries
        n_exits = trade.nr_of_successful_exits

        # Ladder buys: every -1% from average entry, up to 5 adds.
        if n_entries <= 5 and current_profit <= -0.01 * n_entries:
            filled = trade.select_filled_orders(trade.entry_side)
            first_stake = filled[0].stake_amount_filled if filled else (min_stake or 10)
            return (first_stake, f"grid_buy_{n_entries}")

        # Partial profit-take: every +1.5% above avg entry, up to 3 ladders.
        if n_exits < 3 and current_profit >= 0.015 * (n_exits + 1):
            return (-(trade.stake_amount / 4.0), f"grid_tp_{n_exits}")

        return None

Config requirements

json
{
  "exchange": { "name": "hyperliquid", "pair_whitelist": ["ETH/USDC"] },
  "stake_currency": "USDC",
  "stake_amount": 1000,
  "dry_run_wallet": {"USDC": 10000},
  "timeframe": "15m",
  "max_open_trades": 1,
  "stoploss": -0.30,
  "minimal_roi": { "0": 100.0 },
  "entry_pricing": { "price_side": "same" },
  "exit_pricing": { "price_side": "same" },
  "pairlists": [{ "method": "StaticPairList" }]
}

dry_run_wallet ≥ stake_amount is enforced strictly. With 6 ladder rungs, leave headroom — dry_run_wallet ≥ stake_amount × 1.5 is comfortable.

Tunable parameters

KnobEffect
0.99 (entry trigger)Tighter (0.995) → more entries, more chop. Looser (0.97) → rarer, deeper fades.
0.01 * n_entries (ladder spacing)Tighter spacing → faster ladder fills, smaller gain per rung. Wider spacing → fewer rungs in chop.
max_entry_position_adjustmentMore rungs → bigger position when fully laddered, more wallet exposure.
0.015 * (n_exits + 1) (TP step)Tighter TPs → more partial closes, less per close.
1.06 (band breakout)Tighter (1.04) → exit earlier on rallies, capture less.
trade.stake_amount / 4.0 (TP size)Smaller divisor → bigger partial closes. / 2.0 halves the position per TP.

Common pitfalls

  1. Naive single-rung implementation. Using populate_entry_trend with close < vwap × 0.94 and populate_exit_trend with close > vwap × 1.06 produced 0 trades on the same window — ETH never reached the lower band. The laddered version captures the moves the band misses.
  2. stoploss too shallow. With 5 ladder rungs at −1% spacing, a −6% stop kills the trade before the deepest rung fills. Use −30% (or deeper) and rely on partial exits.
  3. Letting minimal_roi close trades early. With the default {"0": 0.02}, the trade exits at +2% before the partial-TP ladder ever runs. Set {"0": 100.0} to disable.
  4. Forgetting current_profit is signed. current_profit <= -0.01 * n_entries reads "drawdown is at least n × 1%". Inverting the sign disables the ladder.

Variants

  • Wider band: 0.97 entry / 1.10 exit for trending pairs (BTC, SOL).
  • Asymmetric ladder: more buys than sells (max_entry_position_adjustment = 8, only 2 partial TPs) for accumulation modes.
  • Volatility-scaled steps: replace fixed 0.01 with atr_pct * 0.5 to make ladder spacing follow regime.

When grid is the wrong tool

  • Strong trends (the band breakout closes the trade after one cycle).
  • Pairs that gap (Hyperliquid index pairs sometimes skip the trigger price entirely).
  • Tight fee budgets — every ladder rung pays maker/taker fees twice (entry and partial exit). See fees-optimizations for cost analysis.

Sources

Frequently asked questions

What does the Grid Trading AI skill do?

Use when writing a profit-laddered position-adjustment strategy on Superior Trade — anything described as a grid bot, range fade, range harvest, ladder buy, scaling-in, pyramiding, or "buy more when it dips and sell partials when it rallies". Note this is a profit-driven ladder, not a true 20-rung order-book grid; explain that limitation when the user asks for true grid trading.

Why use Grid Trading on TypingMind?

Because you install it once and use it with any model. Grid Trading is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Grid Trading in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Superior-Trade/superior-skills/tree/main/skills/grid-trading. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Grid Trading?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Grid Trading?

As many as you like. As long as a model supports skills, you can use Grid Trading with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Grid Trading AI skill free?

Yes. It is published on GitHub by Superior-Trade under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇