Examples

Complete strategies you can paste into the editor.

Example: Conservative BTC

Holds spot BTC with strict trend + momentum filters. Big stops, slow cycles.

strategy "BTC Conservative" {
  timeframe: 1h
  symbols: ["BTCUSDT"]

  indicators {
    rsi      = RSI(14)
    ema_fast = EMA(21)
    ema_slow = EMA(50)
    atr      = ATR(14)
  }

  entry when {
    ema_fast > ema_slow
    rsi in 40..60
    adx > 30
    not_in_cooldown(4h)
  }

  exit when {
    trailing_stop(callback: 2%)
    or rsi > 80
  }

  risk {
    max_position_pct: 3%
    stop_loss_atr: 2
    take_profit_atr: 6
  }

  ai_context {
    model: "deepseek"
    prompt: "Only enter on strong weekly trends."
    min_confidence: 0.7
  }

  schedule {
    cycle_interval: 1h
    dead_hours: [2,3,4,5]
  }
}

Example: Aggressive Scalper

Hunts top-volume pairs on 5m. Many small trades, tight stops. Higher leverage allowed.

strategy "Scalp Machine" {
  timeframe: 5m
  symbols: top_volume(12, quote: "USDT")

  indicators {
    rsi      = RSI(7)
    ema_fast = EMA(5)
    ema_slow = EMA(13)
    atr      = ATR(7)
  }

  entry when {
    ema_fast > ema_slow
    rsi in 30..70
    adx > 20
    min_time_since_last_entry(15m)
    fee_ratio_ok(20%)
  }

  exit when {
    trailing_stop(callback: 0.8%)
    or rsi > 80
    or ema_fast crosses_below ema_slow
  }

  risk {
    max_position_pct: 8%
    stop_loss_atr: 1
    take_profit_atr: 3
  }

  schedule {
    cycle_interval: 5m
    cautious_hours: [0,1,2,22,23]
    cautious_size_penalty: 40%
  }
}

Example: Mean Reversion

Buys oversold, sells back to mean. Best in ranging markets (low ADX).

strategy "Range Hunter" {
  timeframe: 15m
  symbols: ["ETHUSDT", "SOLUSDT"]

  indicators {
    rsi  = RSI(14)
    bb   = Bollinger(20, 2)
    atr  = ATR(14)
  }

  entry when {
    rsi < 35
    price < bb.lower
    adx < 25                       // not trending
    fee_ratio_ok(25%)
  }

  exit when {
    rsi > 55
    or price > bb.upper
    or trailing_stop(callback: 1%)
  }

  risk {
    max_position_pct: 4%
    stop_loss_atr: 1.5
    take_profit_atr: 3
  }
}

Example: DCA + Grid

For non-ThunderScript modes, AiTrade also supports DCA (deterministic interval buys) and Grid (fixed-spacing rungs). Both are deterministic — no AI needed. Configure via the bot create form's Mode dropdown.

AiTrade docs