> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hizz.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Strategy file template

> A complete declarative JSON template for creating an AI Trading strategy.

Use this file as the starting point for Codex, another AI agent, or a manual
strategy author. It is declarative: choose approved module `kind` values and
parameters; do not embed executable code.

<CardGroup cols={2}>
  <Card title="Authoring tutorial" icon="pen-to-square" href="/ai-trading/write-a-strategy">
    Build and validate a strategy one section at a time.
  </Card>

  <Card title="Strategy examples" icon="file-code" href="/ai-trading/strategy-examples">
    Read three complete strategies with different modules and execution policies.
  </Card>
</CardGroup>

```json theme={null}
{
  "name": "ZEC 4h breakout template",
  "thesis": "Trade confirmed four-hour Donchian breakouts in the higher-timeframe trend with an ATR stop and a fixed 2:1 configured target.",
  "frequency": "medium",
  "definition": {
    "schemaVersion": 1,
    "slug": "zec-4h-breakout-template",
    "symbol": "ZEC-USD",
    "trigger": {
      "kind": "donchian_breakout",
      "timeframe": "base",
      "lookback": 20,
      "thresholdBps": 5,
      "clock": "4h"
    },
    "filters": [
      { "kind": "ema_trend", "timeframe": "high", "fast": 20, "slow": 50, "clock": "1d" },
      { "kind": "volume_surge", "timeframe": "base", "window": 20, "multiplier": 1.15, "clock": "4h" }
    ],
    "risk": {
      "kind": "atr_bracket",
      "timeframe": "base",
      "atrPeriod": 14,
      "atrStopMult": 2,
      "riskReward": 2,
      "maxHoldHours": 96
    },
    "sizing": { "riskFraction": 0.2, "leverage": 2 },
    "entryPolicy": { "maxEntriesPerUtcDay": 1 },
    "feeBps": 13,
    "allowLong": true,
    "allowShort": true,
    "reverseOnOpposite": false
  },
  "data": {
    "provider": "pyth",
    "frames": {
      "base": { "interval": "4h", "lookbackDays": 600, "ticker": "Crypto.ZEC/USD" },
      "high": { "interval": "1d", "lookbackDays": 600, "ticker": "Crypto.ZEC/USD" }
    }
  },
  "executionPolicy": {
    "schemaVersion": 1,
    "entryMode": "maker",
    "routineExitMode": "maker",
    "emergencyExitMode": "taker",
    "emergencyExitReasons": ["stop"],
    "maker": {
      "ttlSeconds": 180,
      "offsetBps": 0,
      "entryMaxAttempts": 2,
      "routineExitMaxAttempts": 2,
      "routineExitFallbackSeconds": 420
    },
    "costs": {
      "hizzFeeBps": 5,
      "strikeMakerFeeBps": 0,
      "strikeTakerFeeBps": 8
    }
  }
}
```

The always-current template can be downloaded from
[`GET /api/v1/ai-trading/strategy-template`](https://hizz.io/api/v1/ai-trading/strategy-template).

## Authoring workflow

1. Follow [Write your own strategy](/ai-trading/write-a-strategy)
2. Fetch the live [module registry](/ai-trading/modules)
3. Copy the template and change one concern at a time
4. Submit the complete JSON to `/strategies/validate`
5. Inspect the returned normalized strategy and node graph; hover nodes for module responsibilities and verify every typed port-to-port connection
6. Backtest an existing published slug across several date ranges
7. Review configured risk/reward separately from realized average win/loss
8. Save, deploy, and arm inside the authenticated Hizz application only after human review

## Important field semantics

`risk.riskReward` is the configured initial take-profit distance divided by
the initial stop distance. It is not the realized payoff ratio. Trailing exits,
reversals, timeouts, gaps, and fees can make realized average win / average
loss very different from the configured value.

`feeBps` is a per-fill uniform execution assumption for the generic definition.
Published maker strategies can add an `executionPolicy` so backtests preserve
separate maker and taker costs. Hard stops remain taker exits even when routine
entries and exits are maker orders.

`data.frames` controls market coverage. A provider ticker such as
`Crypto.ZEC/USD` is not interchangeable with the Strike symbol `ZEC-USD`; Hizz
validates and maps those namespaces before a backtest runs.
