# TradingView Alert Templates for JARVIS/ChatGPT 5.5 HyperLiquid Stack

These templates are for TradingView alerts that feed the CryptoTradingBot **paper-only signal journal**.
They must not contain exchange API keys or wallet secrets.

## Webhook Endpoint

Local/Tailnet receiver path:

```text
POST /webhook/tradingview
Header: X-CTB-Webhook-Secret: <secret from runtime secret file/env>
Content-Type: application/json
```

## Required JSON Fields

| Field | Example | Notes |
|---|---|---|
| `source` | `tradingview` | fixed |
| `strategy` | `gaussian_channel_v1` | must be allowlisted in receiver |
| `symbol` | `{{ticker}}` or `BTCUSDT.P` | normalized to HyperLiquid coin, e.g. `BTC` |
| `side` | `long` / `short` | signal direction |
| `action` | `entry` / `exit` | desired signal action |
| `timeframe` | `{{interval}}` | chart timeframe |
| `price` | `{{close}}` | validated positive decimal |
| `timestamp` | `{{time}}` | TradingView time placeholder or ISO string |
| `signal_id` | see examples | duplicate protection |
| `reason` | free text | optional, sanitized |

## Template: Entry Long

```json
{
  "source": "tradingview",
  "strategy": "gaussian_channel_v1",
  "symbol": "{{ticker}}",
  "side": "long",
  "action": "entry",
  "timeframe": "{{interval}}",
  "price": "{{close}}",
  "timestamp": "{{time}}",
  "signal_id": "tv-{{ticker}}-{{interval}}-long-entry-{{time}}",
  "reason": "indicator long entry"
}
```

## Template: Exit Long

```json
{
  "source": "tradingview",
  "strategy": "gaussian_channel_v1",
  "symbol": "{{ticker}}",
  "side": "long",
  "action": "exit",
  "timeframe": "{{interval}}",
  "price": "{{close}}",
  "timestamp": "{{time}}",
  "signal_id": "tv-{{ticker}}-{{interval}}-long-exit-{{time}}",
  "reason": "indicator long exit"
}
```

## Template: Entry Short

```json
{
  "source": "tradingview",
  "strategy": "gaussian_channel_v1",
  "symbol": "{{ticker}}",
  "side": "short",
  "action": "entry",
  "timeframe": "{{interval}}",
  "price": "{{close}}",
  "timestamp": "{{time}}",
  "signal_id": "tv-{{ticker}}-{{interval}}-short-entry-{{time}}",
  "reason": "indicator short entry"
}
```

## Template: Exit Short

```json
{
  "source": "tradingview",
  "strategy": "gaussian_channel_v1",
  "symbol": "{{ticker}}",
  "side": "short",
  "action": "exit",
  "timeframe": "{{interval}}",
  "price": "{{close}}",
  "timestamp": "{{time}}",
  "signal_id": "tv-{{ticker}}-{{interval}}-short-exit-{{time}}",
  "reason": "indicator short exit"
}
```

## Decision Flow

TradingView is only the **impulse source**. A signal does not mean buy/sell.

```text
TradingView impulse
  -> webhook auth + validation
  -> signal journal
  -> paper/shadow candidate
  -> bot risk checks: coin, strategy, market regime, cost/edge, liquidity, spread, funding, stops, exposure, loss gates, kill-switch, reconcile
  -> paper fill or blocked reason
  -> daily report + ChatGPT 5.5 analyst summary
```

## Initial Allowed Strategy IDs

Suggested first IDs:

- `gaussian_channel_v1` — external/TradingView trend channel signal source.
- `squeeze_breakout_1h` — internal-compatible breakout impulse.
- `ema_vwap_reclaim_1h` — trend pullback/reclaim impulse.
- `regime_filter_btc_4h` — context-only regime signal; should not create entries directly.

## Safety Notes

- Alerts are accepted into `runtime/signals/signal_journal.jsonl` only.
- Rejected alerts are audited in `runtime/signals/rejected_signal_journal.jsonl`.
- No TradingView alert may directly call HyperLiquid.
- Promotion from paper to live requires separate explicit gates and approval.
